Previously, we’ve discussed about some WordPress plugins to improve and replace default search engine. The default search does not return relevant results because the results are based on date rather than relevancy. A solution to this problem would be to use some other alternative such as DuckDuckGo (also known as DDG). In this post, you will learn how to add DuckDuckGo to WordPress site.
For those who don’t know about DuckDuckGo, then it is a search engine that’s focused on privacy. It does not tracks your search queries and does not collect or share any personal information. This means that you search anonymously, no more search history or tracking.
So if you’re thinking to add/integrate DuckDuckGo to your WordPress based site, then simply follow this tutorial.
Go to the official DuckDuckGo search box page from this link. Next, configure options as per your needs. For example, you can change the width of the search box, show/hide DuckDuckGo logo, change background color, enter your site’s URL, prefill text and enable/disable autofocus.
Of all these options, don’t forget to enter your website’s URL in “Site search” field and change the Prefill text. You might also want to change the width of the search box, based on your website.
Once you select and configure all the options, copy the highlighted code and place it in a text widget.
To do this, go to Appearance > Widgets and place the text widget on any widgetized area, such as sidebar, and paste the code.
The above code will add a search box to your site and upon searching, the visitor will be taken to DuckDuckGo with the search results. Unfortunately, DuckDuckGo does not allow you to host search results on your site (e.g. in a frame).
This is by far the most easiest method to add DuckDuckGo to WordPress site. You can also use many additional URL parameters to control various elements like fonts, region settings, color settings, look and feel and more, to further customize the results pages.
Also read: How to Add Google Custom Search to WordPress