<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WPWife &#187; wordpress search url</title>
	<atom:link href="http://www.wpwife.com/category/wordpress-search-url/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wpwife.com</link>
	<description>WPHelp: fix and optimise WP themes&#38;plugins</description>
	<lastBuildDate>Fri, 21 Nov 2025 12:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.38</generator>
	<item>
		<title>How to Change the Default Search URL Slug in WordPress</title>
		<link>http://www.wpwife.com/tutorials/how-to-change-the-default-search-url-slug-in-wordpress</link>
		<comments>http://www.wpwife.com/tutorials/how-to-change-the-default-search-url-slug-in-wordpress#comments</comments>
		<pubDate>Thu, 08 Mar 2018 12:35:12 +0000</pubDate>
		<dc:creator><![CDATA[Editorial Staff]]></dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress search]]></category>
		<category><![CDATA[wordpress search url]]></category>
		<category><![CDATA[wordpress seo]]></category>

		<guid isPermaLink="false">http://www.wpbeginner.com/?p=50946</guid>
		<description><![CDATA[
<p>Do you want to change the default search URL slug in WordPress? By default, WordPress search URLs are not user friendly. In this article, we will show you how to easily change the default search url slug in WordPress and make it more SEO and&#8230;&#160;<strong><a href="http://www.wpbeginner.com/wp-tutorials/how-to-change-the-default-search-url-slug-in-wordpress/">Read More &#187;</a></strong></p>
<p>The post <a rel="nofollow" href="http://www.wpbeginner.com/wp-tutorials/how-to-change-the-default-search-url-slug-in-wordpress/">How to Change the Default Search URL Slug in WordPress</a> appeared first on <a rel="nofollow" href="http://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Do you want to change the default search URL slug in WordPress? By default, WordPress search URLs are not user friendly. In this article, we will show you how to easily change the default search url slug in WordPress and make it more SEO and user friendly. </p>
<p><img title="Changing default WordPress search URL slug" src="http://cdn4.wpbeginner.com/wp-content/uploads/2018/03/searchurlslugwp.png" alt="Changing default WordPress search URL slug" width="550" height="340" class="alignnone size-full wp-image-50949" /></p>
<h4>Why Change Default Search URL Slug in WordPress</h4>
<p>WordPress uses <a href="http://www.wpbeginner.com/wp-tutorials/seo-friendly-url-structure-for-wordpress/" title="What is a SEO Friendly URL Structure in WordPress">SEO friendly URL structure</a> for all pages on your website. Typical SEO friendly WordPress URLs look like this: </p>
<p>http://example.com/some-page/<br />
http://example.com/2018/03/some-article/<br />
http://example.com/category/some-category/ </p>
<p>As you can see, these URLs are quite easy to understand for users as well as search engines. </p>
<p>However, WordPress still uses non-friendly URL for search results page. A typical search URL in WordPress looks like this: </p>
<p>http://example.com/?s=search-term</p>
<p>This URL structure doesn&#8217;t match the rest of your website URLs. While some <a href="http://www.wpbeginner.com/showcase/12-wordpress-search-plugins-to-improve-your-site-search/" title="12 WordPress Search Plugins to Improve Your Site Search">WordPress search plugins</a> improve the search results, most don&#8217;t do anything about the search URL itself.</p>
<p>What if you can make your search URL look like:</p>
<p>http://example.com/search/your-search-term/</p>
<p>Let&#8217;s take a look at how to make the WordPress search page URL slug more SEO friendly. </p>
<h4>Changing Search Page URL Slug in WordPress</h4>
<p>For this tutorial you will need to edit your WordPress theme files. If you haven&#8217;t done this before, then please take a look at our guide on <a href="http://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/" title="Beginner’s Guide to Pasting Snippets from the Web into WordPress">how to copy and paste code</a> in WordPress. </p>
<h4>Method 1. Change WordPress Search URL Slug via Functions File</h4>
<p>This method is easier and recommended for most users. </p>
<p>First, you need to copy and paste the following code in your theme&#8217;s <a href="http://www.wpbeginner.com/glossary/functions-php/" title="What is functions.php File in WordPress?">functions.php</a> file or a <a href="http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/" title="What, Why, and How-To’s of Creating a Site-Specific WordPress Plugin">site-specific plugin</a>: </p>
<pre class="brush: php; title: ; notranslate">
function wpb_change_search_url() {
	if ( is_search() &amp;&amp; ! empty( $_GET['s'] ) ) {
		wp_redirect( home_url( &quot;/search/&quot; ) . urlencode( get_query_var( 's' ) ) );
		exit();
	}	
}
add_action( 'template_redirect', 'wpb_change_search_url' );
</pre>
<p>Don&#8217;t forget to save your changes. </p>
<p>You can now go to your website and try using the search feature. You will notice that the search URL looks like this: </p>
<p>http://example.com/search/your-search-query/</p>
<p><img title="searchresults" src="http://cdn3.wpbeginner.com/wp-content/uploads/2018/03/searchresults.jpg" alt="" width="550" height="300" class="alignnone size-full wp-image-50963" /></p>
<h4>Method 2. Change Search URL Slug via htaccess File</h4>
<p>The <a href="http://www.wpbeginner.com/glossary/htaccess/" title="What is .htaccess File in WordPress?">.htaccess file</a> is often used to set up redirects and other website configuration tasks. You can also use it to change the default search URL slug in WordPress. </p>
<p>Your .htaccess file is located in your website&#8217;s root folder, and you will need to use FTP or File Manager app in cPanel to edit it. Refer to this guide, if you <a href="http://www.wpbeginner.com/beginners-guide/why-you-cant-find-htaccess-file-on-your-wordpress-site/" title="Why You Can’t Find .htaccess File on Your WordPress Site">can&#8217;t find the .htaccess file</a>. </p>
<p>In your .htaccess file, you need to paste the following code at the bottom: </p>
<pre class="brush: php; title: ; notranslate">
# Change WordPress search URL
RewriteCond %{QUERY_STRING} \\?s=([^&amp;]+) [NC]
RewriteRule ^$ /search/%1/? [NC,R,L]
</pre>
<p>Don&#8217;t forget to save your changes and upload the .htaccess file back to the server. </p>
<p>You can now go to your website and use the search feature. You will notice the search URL will now look like this: </p>
<p>http://example.com/search/your-search-query/</p>
<p>We hope this article helped you change the default search URL slug in WordPress. You may also want to see our list of <a href="http://www.wpbeginner.com/wp-tutorials/55-most-wanted-wordpress-tips-tricks-and-hacks/" title="55+ Most Wanted WordPress Tips, Tricks, and Hacks">55+ most wanted WordPress tips, tricks, and hacks</a>. </p>
<p>If you liked this article, then please subscribe to our <a href="http://youtube.com/wpbeginner?sub_confirmation=1" title="WPBeginner on YouTube"  rel="nofollow">YouTube Channel</a> for WordPress video tutorials. You can also find us on <a href="http://twitter.com/wpbeginner" title="WPBeginner on Twitter"  rel="nofollow">Twitter</a> and <a href="https://www.facebook.com/wpbeginner" title="WPBeginner on Facebook"  rel="nofollow">Facebook</a>.</p>
<p>The post <a rel="nofollow" href="http://www.wpbeginner.com/wp-tutorials/how-to-change-the-default-search-url-slug-in-wordpress/">How to Change the Default Search URL Slug in WordPress</a> appeared first on <a rel="nofollow" href="http://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwife.com/tutorials/how-to-change-the-default-search-url-slug-in-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="0" type="" />
		</item>
	</channel>
</rss>
