Description: The article is about wordpress login. This is a tutorial about how to change the default search URL slug in WordPress. The author shows two methods to make the change. Both two methods are very useful,you can choose the one suitable for you.
Are you looking for an easy way to change the default search URL slug in WordPress? In this tutorial I’ll walk you through on how ton change the default search URL structure on your WordPress website. I’ll show you two methods so you can pick the one that works best for you. Both will require an FTP client,you can use any client that you want.
In this tutorial we’ll use FileZilla for ours. It is the first method we’ll use,this will change the WordPress search URL slug through functions file,we’ll add this function to our functions.php file. So I need to copy this,from your FTP client you need to go into your public HTML,you need to go into your content area,you need to go into the theme that you’re using,you’ll need to know which theme you’re using so you can go into the folder.
We’re using the 2016 theme,and from here you need to find your functions page. This is the one we have,let’s right-click and download it. On the left,it will download to a folder area on your computer. Now that you’ve downloaded it,you’ll need to open it up by using a text editor. Any editor will do that,I’ll use notepad++. From here you can scroll all the way down,I like to add new functions at the bottom and we need to start a new line and a comment.
From here you can paste the code that we copied from the WPBeginner page. Make sure everything looks good and then we can go back up here and save it. Go back to our FileZilla,I’ll click on there and upload. When it uploads,you need to say OK to overwriting it.
Now that we’ve uploaded it,we can go to our the front end of our website and test it out,now you can see that I have a nice clean URL. Once I’ve typed in my search item,it says search and WordPress,it is the item that I put in to search for.
The second method is similar,however we will add this code to our htaccess file instead of our WordPress theme. The great thing about method 2 is that if you change themes,you’ll still have this functionality on your website because you’re using it. So let’s head back over to FileZilla.
We are in our content themes area,so we need to go up a little bit. So I’m going to click on the little dots,I’m moving up in the file structure,I’m going to click on it one more time. From the public HTML folder,you can see htaccess. Go ahead and download that,once we’ve downloaded it,let’s go ahead and open it with our favorite text editor.
From here,you simply need to paste the following code at the bottom of everything. So we’ll go down to the bottom and we’ll paste that bit of code. With the functions file,you need to save that,you need to go back to our htaccess,we’ll click and upload it.
You need to overwrite and now I can change themes,we can go to visit the site,and when I type in the search function,you’ll see the search results are in a nice SEO friendly URL slug. So those are two methods. As you can see method two is a little bit more robust because it will work for your website regardless of which theme you use. Did you learn something? We’ll send more helpful tips to help you manage your WordPress website.