WordPress: Which Search Feature is Better? Google’s or Native?
More and more websites choose to use Google's search engine instead of the native WordPress search. The Google search is supposed to be much better, as well as deliver more precise results. But is this really the case? Is the WordPress search function really so bad that it should be replaced? Here's my report. Google Custom Search is considered to be a great alternative to the native WordPress Search, as it's said to simply deliver better results. On top of that, the displayed ads even allow you to make money off of it. This is the advertising promise made by Google. But what does the reality look like? Are the results actually more precise, and is it really possible to make money off of the ads?
Making Money Via Google SearchI'm sure there are websites that earn one or two bucks off the ad blocks. But this won't make you rich. I know lots of websites with a rather good amount of traffic that have barely earned a penny off these ads. If you happen to be the owner of a website like the Smashing Magazine, it may be different for you. But even with 300,000 unique visitors a month, you'll struggle to get a penny from the ads. It's just not worth it. Dr. Web, and Noupe have used the Google's Custom Search for years. There was no notable revenue. By now, they have switched back to native WordPress Search on both websites.
Setting Up Custom Search for Your WebsiteYou can easily set up Custom Search for your blog, and quickly change back to the regular search if you just want to try it. A test doesn't hurt. I have written a tutorial on setting up the Google custom search engine. Simply follow the guide, the setup only takes a few minutes. Here's a Video to Give You an Impression: https://youtu.be/Qd9z48Bo8ZA
The Search Results: Google vs. WordPressAs you can easily switch between the two engines, I have put in the effort to compare the two with one search term. Under optimal circumstances, there is no difference at all. Screenshot of Custom Search: Screenshot of the WordPress Search: I could use a different search term, and there wouldn't be much of a difference in the results. The WordPress search is certainly better than its reputation. And the Google search doesn't always deliver optimal results.
Relevance is Crucial. Does Google Have the Edge Here?I have tested the two engines in-depth on my own website. To me, the relevance of the search results that my visitors get to see is important. I want every person that is looking for something on my website to find the desired information. That's the only way a random visitor could turn into a regular user of my blog. Up to this point, it's clear that both searches deliver good results. To test which of the two has the better ones, I have entered a search term that was supposed to lead to a single result.
The Result:Google Screenshot: WordPress Screenshot: Both search engines have delivered the optimal result, followed by a couple completely useless results.
The Final Result of the ComparisonI consider both search variants to be suitable. Both searches have delivered top results for the tested keywords. When looking for terms with lots of search results, both engines will deliver good and relevant ones. When searching for terms where only one result is possible, both functions give you the correct result, followed by useless entries. To me, WordPress Search is the winner nonetheless, as the results simply look better, and are optimally integrated into the theme's design.
Improving WordPress SearchThe result of the WordPress Search can be improved visually. When the keyword is highlighted in the search result, users will be able to know that the result is what they are looking for right away. [caption id="attachment_80980" align="alignnone" width="1000"] Due to the Highlighting, The Visitor Can See the Desired Result Right Away.[/caption] Since we have to edit a template file to make changes to WordPress Search, you should create a child theme. Then, the changes will remain even after a theme update.
Important: Always make a backup of the theme files before working on them. Additionally, you should never work with the WordPress editor, but always directly alter the files via FTP. This lets you replace flawed files with the originals quicker.How to: Noupe's Guide to WordPress Child Themes
Highlighting WordPress Search Results: How toDepending on the theme, one or two files need to be adjusted. To figure this out, download the
search.phpto your desktop via FTP. Open it with an HTML editor. If you don't have one, pick one from our lists.
- The 5 Best Free HTML Editors for Web Developers (Mac-Edition)
- The 9 Best Free HTML Editors for Web Developers (Windows-Edition)
search.phptells you if you have to edit a second file, as well as what it's called. I have to alter two files. You have to add a
<mark>element to the heading of the
search.php. For me, the second file is the
listed-search.php. It can definitely be a different one for you, and there may be only one file responsible for the display of the search results. Copy the following code into the very top of the file: https://gist.github.com/anonymous/fb44b915b183140dba12d2fbfb9daaf8 Now, replace
<?php the_title(); ?>with
<?php echo $titel; ?>in the heading. Replace the tag
<?php the_excerpt(); ?>with
<?php echo $auszug; ?>. [caption id="attachment_80994" align="alignnone" width="1200"] Replacing the Two WordPress Tags.[/caption] Now load the file or files into your (child-) theme folder via FTP, and you're done. Now try your search. If it is highlighted in color, everything's fine. If not, your theme CSS is missing the designation for the
<mark>element. Add the following CSS to your
style.css, if it's missing: https://gist.github.com/anonymous/8f9b270b732c86a9561d816185e81c73 Now, the search results should be highlighted.