Do you wish to change the default search URL slug in WordPress? By default, WordPress search URLs will not be consumer pleasant. On this article, we are going to present you the right way to simply change the default search url slug in WordPress and make it extra search engine marketing and consumer pleasant.
Why Change Default Search URL Slug in WordPress
WordPress makes use of search engine marketing pleasant URL construction for all pages in your web site. Typical search engine marketing pleasant WordPress URLs seem like this:
As you’ll be able to see, these URLs are fairly straightforward to know for customers in addition to serps.
Nonetheless, WordPress nonetheless makes use of non-friendly URL for search outcomes web page. A typical search URL in WordPress seems like this:
This URL construction doesn’t match the remainder of your web site URLs. Whereas some WordPress search plugins enhance the search outcomes, most don’t do something in regards to the search URL itself.
What if you can also make your search URL seem like:
Let’s check out the right way to make the WordPress search web page URL slug extra search engine marketing pleasant.
Altering Search Web page URL Slug in WordPress
For this tutorial you will want to edit your WordPress theme recordsdata. Should you haven’t carried out this earlier than, then please check out our information on the right way to copy and paste code in WordPress.
Technique 1. Change WordPress Search URL Slug by way of Capabilities File
This technique is simpler and really useful for many customers.
First, you have to copy and paste the next code in your theme’s features.php file or a site-specific plugin:
Don’t neglect to save lots of your modifications.
Now you can go to your web site and check out utilizing the search characteristic. You’ll discover that the search URL seems like this:
Technique 2. Change Search URL Slug by way of htaccess File
The .htaccess file is commonly used to arrange redirects and different web site configuration duties. You can even use it to vary the default search URL slug in WordPress.
Your .htaccess file is situated in your web site’s root folder, and you will want to make use of FTP or File Supervisor app in cPanel to edit it. Check with this information, when you can’t discover the .htaccess file.
In your .htaccess file, you have to paste the next code on the backside:
Don’t neglect to save lots of your modifications and add the .htaccess file again to the server.
Now you can go to your web site and use the search characteristic. You’ll discover the search URL will now seem like this:
You May Also Like : How to Add YouTube Subscribe Button in WordPress
We hope this text helped you alter the default search URL slug in WordPress. You might also wish to see our listing of 55+ most needed WordPress ideas, tips, and hacks.
If you liked this article, make sure to hit the bell for getting our latest updates and share this article with your friends in every social media platforms.