{"id":8721,"date":"2020-03-04T10:07:20","date_gmt":"2020-03-04T08:07:20","guid":{"rendered":"https:\/\/vipestudio.com\/?p=8721"},"modified":"2020-03-04T10:07:38","modified_gmt":"2020-03-04T08:07:38","slug":"why-wordpress-search-isn-t-amazing-and-how-to-improve-it","status":"publish","type":"post","link":"https:\/\/vipestudio.com\/en\/why-wordpress-search-isn-t-amazing-and-how-to-improve-it\/","title":{"rendered":"Why WordPress Search isn\u2019t amazing and How to Improve it?"},"content":{"rendered":"<p>Welcome back to this ongoing series on <strong>WordPress Search<\/strong> \u2013 In Part 1, we discussed all the ways in which you can add search to your WordPress-based website; here we\u2019ll look at why Search needs to be improved and how you can get down to making your search blazing fast and your website a pleasure to navigate.<\/p>\n<h2>1. Why WordPress Search isn\u2019t all that great<\/h2>\n<p>As we have already learned in Part 1, the basic search can be added to your WordPress website quite easily and in many ways. However, it wouldn\u2019t be adequate for your search needs unless you\u2019re running a fairly limited website or search isn\u2019t really that important to your visitors. I doubt that, but if your website is ambitious, the better search will be indispensable in your grand scheme for internet domination.<\/p>\n<p>Here\u2019s why. WordPress search does its job well, but it looks in far fewer places than a visitor to your website would expect it to \u2013 only page titles, text, image titles, alt text and captions, and file names. That\u2019s it. It won\u2019t include comments, tags, widgets or other custom elements, or even your non-basic content, including WooCommerce products. That\u2019s pretty limited.<\/p>\n<p>In addition, if (and when) your website gets larger and adds more pages and content, not only will WordPress Search turn up fewer results, it will take far longer to serve them up too! To put it bluntly, WordPress Search just wasn\u2019t built to conduct deep or fast searches. It\u2019s basic and your website is not going to stay basic very long.<\/p>\n<p>So we need something that can step in and retrieve those quick, in-depth, relevant results for your patrons, and make them keep coming back to you for that sweet search experience. Let\u2019s see how.<\/p>\n<h2>2. Making WordPress Internal Search a Whole Lot Better<\/h2>\n<h3><em>A Dedicated Search Page instead of a Search Bar<\/em><\/h3>\n<p>People on the internet are no strangers to using search, but a separate search page will make it convenient for them. For this, you\u2019ll have to access your website backend \u2013 FTP or a file explorer will do. Open the WordPress database, and browse to <strong>\/wp-content\/themes\/[your theme]\/page.php<\/strong><\/p>\n<p>This file describes the basic web page structure within your theme called\u2026 well, \u2018your theme\u2019. Please remember to do nothing with the similarly-named file \u2018<strong>search.php<\/strong>\u2019, which is NOT the advanced search page; it defines the structure of the search results page.<\/p>\n<p>Now, create a <strong>copy of page.php<\/strong>, rename it to <strong>searchpage.php<\/strong>, and open the new file in edit mode.<\/p>\n<p>A majority of the code in this file is applicable to a general blog entry or web page, and we can get rid of it. In doing so, we can trim it down to the essentials of what\u2019s needed on the search page. For example:<\/p>\n<pre><span style=\"color: #009999;\">&lt;?php<\/span> <span style=\"color: #0099ff; font-style: italic;\">\/* Template Name: Search Page *\/<\/span> <span style=\"color: #009999;\">?&gt;<\/span>\r\n<span style=\"color: #009999;\">&lt;?php<\/span> get_header(); <span style=\"color: #009999;\">?&gt;<\/span> \r\n&lt;div class=\"wrap\"&gt;\r\n&lt;div id=\"primary\" class=\u201dcontent-area\u201d&gt;\r\n&lt;main id=\"main\" class+\u201dsite-main\u201d role=\"main\"&gt;\r\n&lt;h1&gt;My Blog Search&lt;\/h1&gt; \r\n&lt;p&gt;Find here all that ye seek within my blog!&lt;\/p&gt;\r\n&lt;p&gt;With this search form, commence your journey through this blog.&lt;\/p&gt;\r\n<span style=\"color: #009999;\">&lt;?php<\/span> get_search_form(); <span style=\"color: #009999;\">?&gt;<\/span> \r\n&lt;\/main&gt;&lt;!-- #main --&gt; \r\n&lt;\/div&gt;&lt;!-- #primary --&gt; \r\n&lt;\/div&gt;&lt;!-- .wrap --&gt; \r\n<span style=\"color: #009999;\">&lt;?php<\/span> get_footer(); <span style=\"color: #009999;\">?&gt;<\/span>\r\n<\/pre>\n<p>Refer to the WordPress Codex to find out the dos and don\u2019ts of search page creation. On a basic level though, to get the results from code such as the above, you just need to change the content lying between<\/p>\n<pre>&lt;main id=\"main\" class=\u201dsite-main\u201d role=\"main\"&gt;<\/pre>\n<p>and<\/p>\n<pre><span style=\"color: #009999;\">&lt;?php<\/span> get_search_form(); <span style=\"color: #009999;\">?&gt;<\/span><\/pre>\n<p>Proceed to save the template searchpage.php and return to WordPress. Next, create a webpage named \u2018Search\u2019, give it a title and navigate to <strong>\u2018Page Attributes\u2019<\/strong> in the sidebar, where you will now find (and select) the template <strong>\u2018My Blog Search\u2019<\/strong> that you have created. Once the page is published, you can see it live at the URL \u2013 which should usually be yourwebsitedomain.com\/search\/<\/p>\n<h3>Use the WordPress Extended Search plugin to enhance WordPress Search<\/h3>\n<p>If you only intend to let your search cover more ground in your website and retrieve results from more content, employ the simple and easily-set-up WordPress Extended Search plugin. This plugin helps your visitors search through media, tags, categories, excerpts and even metadata, in addition to the kinds of content that native search can handle.<\/p>\n<p><em>In Part 3, we\u2019ll elaborate on more ways that WordPress Search can be improved.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome back to this ongoing series on WordPress Search \u2013 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8726,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[113],"tags":[167,154,166],"class_list":["post-8721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website-wordpress-development","tag-customization","tag-search","tag-wordpress-search"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/posts\/8721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/comments?post=8721"}],"version-history":[{"count":0,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/posts\/8721\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/media\/8726"}],"wp:attachment":[{"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/media?parent=8721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/categories?post=8721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/tags?post=8721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}