{"id":12826,"date":"2021-12-22T12:16:21","date_gmt":"2021-12-22T12:16:21","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=12826"},"modified":"2023-09-08T12:14:40","modified_gmt":"2023-09-08T11:14:40","slug":"change-wordpress-site-search-url-slug-directadmin","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/","title":{"rendered":"How to Change a WordPress Site&#8217;s Search URL Slug via DirectAdmin?"},"content":{"rendered":"<p>SEO-friendly URLs are beneficial for indexing but that is all there is to it. The secret to advance the search engine ranking lies in the platform\u2019s default search website structure and <a href=\"https:\/\/www.milesweb.co.uk\/hosting\/url-hosting\">URL hosting<\/a>. With DirectAdmin, users can improve the search URL slug of any WordPress site <em>(http:\/\/www.example.com\/?s=search-term)<\/em> to raise its overall SEO status.<\/p>\n<p>With a few adjustments, your search URL slugs will be more in tune with your site\u2019s permalinks format. We have talked about configuring the Functions File and changing the .htaccess file. The idea is to change the site&#8217;s present search URL slug:<br \/><em>http:\/\/www.example.com\/?s=search-term<\/em> into this <em>http:\/\/www.example.com\/search\/search-term<\/em>.<\/p>\n<div class=\"skrlto-container\">\n<div class=\"skrlto-header-title\">Table of Contents<\/div>\n<div class=\"skrlto-links-wrapper\">\n<div class=\"skroll-button\" data-skrolllto=\"1URLslugSEO\">Rearrange Site&#8217;s Function File<\/div>\n<div class=\"skroll-button\" data-skrolllto=\"2URLslugSEO\">Improve Search URL Slug with .htaccess<\/div>\n<\/div>\n<\/div>\n\n\n<p><div class=\"vlt-box vlt-purple\">\n<div class=\"box-title\">Did you know!<\/div>\n<div class=\"box-content\">\n<p>Configuring your WordPress website with SEO-friendly URLs will only index posts and pages which, is not enough to improve SEO ranking. The structure of these search URLs should also seem genuine and easy to read for search engine crawlers to optimize the search pages for search engines.<\/p>\n<p><\/p><\/div>\n<\/div><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1URLslugSEO\">Rearrange Site&#8217;s Function File<\/h2>\n\n\n\n<p>1. Log in to your <em>user<\/em> account of DirectAdmin.<\/p>\n\n\n\n<p>2. Go to the <strong>System Info &amp; Files <\/strong>section and click on <strong>File Manager<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg\"><img decoding=\"async\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg\" alt=\"\" class=\"wp-image-9984\"\/><\/a><\/figure>\n\n\n\n<p>The File Manager interface will open.<\/p>\n\n\n\n<p>3. Browse <strong>functions.php<\/strong> file by following the path <strong>public_html&gt;&gt;wp-content &gt;&gt; themes<\/strong>.<\/p>\n\n\n\n<p>4. Right-click the <strong>functions.php<\/strong> file and select <strong>Edit<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/12\/da_edit_functions_file.png\"><img decoding=\"async\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/12\/da_edit_functions_file-1024x544.png\" alt=\"\" class=\"wp-image-14600\"\/><\/a><\/figure><\/div>\n\n\n\n<p>The file will open in the <em>editor<\/em> window.<\/p>\n\n\n\n<p>5. Paste the given code at the end of the file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/**\n* Change search page slug.\n*\/\n\nfunction wp_change_search_url() {\n    if ( is_search() &amp;&amp; ! empty( $_GET['s'] ) ) {\n        wp_redirect( home_url( \"\/search\/\" ) . urlencode( get_query_var( 's' ) ) );\n        exit();\n    }  \n}\nadd_action( 'template_redirect', 'wp_change_search_url' );<\/pre>\n\n\n\n<p>6. Click <strong>SAVE<\/strong> and <em>close<\/em> the editor.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/12\/da_edit_functions_file_search_url_slug.png\"><img decoding=\"async\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/12\/da_edit_functions_file_search_url_slug-1024x436.png\" alt=\"\" class=\"wp-image-14599\"\/><\/a><\/figure><\/div>\n\n\n\n<p>It should change the structure of the search URL slug to the most optimum level.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2URLslugSEO\">Improve Search URL Slug with .htaccess<\/h2>\n\n\n\n<p>1. Log in to your DirectAdmin account.<\/p>\n\n\n\n<p>2. Open <strong>File Manager<\/strong> and <em><strong>edit<\/strong><\/em> the <strong>.htaccess<\/strong> file.<\/p>\n\n\n\n<p><div class=\"kb-box-focus   kb-box-focus-rounded   kb-box-focus-blue\">\n\t<p><strong>Note<\/strong>: You can refer to this article to help you understand <a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/create-edit-htaccess-file-directadmin\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Create\/Edit .htaccess File via DirectAdmin?<\/a><\/p>\n<\/div><\/p>\n\n\n\n<p>3. Paste this code at the end of the file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Change WordPress search URL slug\nRewriteCond %{QUERY_STRING} \\\\?s=([^&amp;]+) [NC]\nRewriteRule ^$ \/search\/%1\/? [NC,R,L]<\/pre>\n\n\n\n<p>4.  Click <strong>SAVE<\/strong> and <em>close<\/em> the editor. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/12\/da_edit_htaccess_search_url_slug.png\"><img decoding=\"async\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/12\/da_edit_htaccess_search_url_slug-1024x436.png\" alt=\"\" class=\"wp-image-14601\"\/><\/a><\/figure>\n\n\n\n<p>DirectAdmin users can use any one of the methods and amend the search URL slug of a WordPress site, improving its SEO.<\/p>\n\n\n<div class=\"vlt-box vlt-purple\">\n<div class=\"box-title\">P.S.<\/div>\n<div class=\"box-content\">\n<p>Users can also use the FTP client to download the <em>functions.php<\/em> or <em>.htaccess file<\/em>, edit and then reupload them on the server.<\/p>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>SEO-friendly URLs are beneficial for indexing but that is all there is to it. The secret to advance the search engine ranking lies in the platform\u2019s default search website structure and URL hosting. With DirectAdmin, users can improve the search URL slug of any WordPress site (http:\/\/www.example.com\/?s=search-term) to raise its overall SEO status. With a [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1777,41,17],"tags":[2583,2833,2834,730,2835,220],"class_list":["post-12826","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-directadmin","category-howtos","category-wordpress-faq","tag-directadmin-users","tag-search-url-slug","tag-search-url-slug-wordpress","tag-seo","tag-url-slug-wordpress-directadmin","tag-wordpress-website-url"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Change a WordPress Site&#039;s Search URL Slug via DirectAdmin?<\/title>\n<meta name=\"description\" content=\"This guide will help DirectAdmin users change the structure of the search URL slug, improving the SEO of a WordPress site.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change a WordPress Site&#039;s Search URL Slug via DirectAdmin?\" \/>\n<meta property=\"og:description\" content=\"This guide will help DirectAdmin users change the structure of the search URL slug, improving the SEO of a WordPress site.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-22T12:16:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-08T11:14:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg\" \/>\n<meta name=\"author\" content=\"Prasad Khartadkar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasad Khartadkar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/\",\"name\":\"How to Change a WordPress Site's Search URL Slug via DirectAdmin?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg\",\"datePublished\":\"2021-12-22T12:16:21+00:00\",\"dateModified\":\"2023-09-08T11:14:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e\"},\"description\":\"This guide will help DirectAdmin users change the structure of the search URL slug, improving the SEO of a WordPress site.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg\",\"contentUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg\",\"width\":417,\"height\":171},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change a WordPress Site&#8217;s Search URL Slug via DirectAdmin?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e\",\"name\":\"Prasad Khartadkar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fafb102a39aa8f8d38a11f3e2dcfa746?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fafb102a39aa8f8d38a11f3e2dcfa746?s=96&d=blank&r=g\",\"caption\":\"Prasad Khartadkar\"},\"description\":\"Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/prasad-khartadkar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change a WordPress Site's Search URL Slug via DirectAdmin?","description":"This guide will help DirectAdmin users change the structure of the search URL slug, improving the SEO of a WordPress site.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/","og_locale":"en_GB","og_type":"article","og_title":"How to Change a WordPress Site's Search URL Slug via DirectAdmin?","og_description":"This guide will help DirectAdmin users change the structure of the search URL slug, improving the SEO of a WordPress site.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2021-12-22T12:16:21+00:00","article_modified_time":"2023-09-08T11:14:40+00:00","og_image":[{"url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg","type":"","width":"","height":""}],"author":"Prasad Khartadkar","twitter_misc":{"Written by":"Prasad Khartadkar","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/","name":"How to Change a WordPress Site's Search URL Slug via DirectAdmin?","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg","datePublished":"2021-12-22T12:16:21+00:00","dateModified":"2023-09-08T11:14:40+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e"},"description":"This guide will help DirectAdmin users change the structure of the search URL slug, improving the SEO of a WordPress site.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#primaryimage","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg","contentUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2021\/02\/file-manager-min.jpg","width":417,"height":171},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/change-wordpress-site-search-url-slug-directadmin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Change a WordPress Site&#8217;s Search URL Slug via DirectAdmin?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e","name":"Prasad Khartadkar","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fafb102a39aa8f8d38a11f3e2dcfa746?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fafb102a39aa8f8d38a11f3e2dcfa746?s=96&d=blank&r=g","caption":"Prasad Khartadkar"},"description":"Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/prasad-khartadkar\/"}]}},"views":364,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/12826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=12826"}],"version-history":[{"count":3,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/12826\/revisions"}],"predecessor-version":[{"id":15028,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/12826\/revisions\/15028"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=12826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=12826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=12826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}