Increasing website visits also involves having user-friendly search URLs. However, the default search URL looks like this: https://hirejordansmith.com/?s=website. This structure is SEO-friendly, but not user-friendly.
In this article, I will show you how to change this default WordPress search URL slug to something cleaner. From the URL shown above to a simpler link like this: https://hirejordansmith.com/search/website
To do this, we need to use an FTP client and your .htaccess file.
So, let’s start!
STEP 1. In your FTP client, open the /public_html folder.
STEP 2. Download your .htaccess file. Open it with a text editor.
STEP 3. Copy the code below:
# Change WordPress search URL
RewriteCond %{QUERY_STRING} \\?s=([^&]+) [NC]
RewriteRule ^$ /search/%1/? [NC,R,L]
STEP 4. Go back to the text editor and paste this code at the bottom. Then Save.
STEP 5. Open the FTP client again and right-click the downloaded .htaccess file and click Upload, then agree to Overwrite.
That’s it! Go back to your site and try your search function to see the new and cleaner URL slug!
Leave a Reply