It appears that the search results returned from the standard Newspaper Theme ‘search’ bar includes results from outside sites. How can I limit it to only show results from within my site?
It only returned results from my site on launch but something has changed…
-General Search Theme Template (in use)
Please advise on fix.
Thanks!
Hi,
Unfortunately, please note that by default, the main functionality of our search bar is to display only the results from your website and not from some outside websites, sorry! It seems to be strange if your search displays you some other results from outside websites, sorry! Please check your plugins list and if you are using some untested plugins, please remove all of them, clear all the caches, purge CDN files and check the results. This is the first step for WordPress debugging.
Thank you!
Did you take a quick look at my site and test the search functionality?
It’s the standard Newspaper Theme with no custom code.
I have not added any additional plugins to my site since it launched… at that time the search functionality was working correctly.
Deactivated/reactivated Plugins, Flushed Cache from SuperCacher (server based, not plugin) but site search is still returning external links…
Any additional assistance would be appreciated.
Any code to force search to my domain only… although that should be the default functionality.
Current Plugins:
– Calendarize it! for WordPress
– Classic Editor
– Contact Form 7 (Tested)
– Envato Market
– tagDiv Cloud Library (OK)
– tagDiv Composer (OK)
– tagDiv Social Counter (OK)
– Thrive Leads
– WPML Multilingual CMS
– WPML String Translation
– WPML Translation Management
Thanks.
Thanks for your response.
If you click on the ‘magnifying glass’ icon in the top right corner of the website (cubanartnews.org) and search for ‘painter’ you’ll see that the first 4 results are external links.
As you know this is not the expected default behavior of the standard WP search.
I’d like to ensure that the basic search functionality returns only results/posts from within my domain (cubanartnews.org).
Is a modification required to the searchform.php file?
Here are the search results:
– Feature: Cuban painter creates works with deep roots in China
https://bit.ly/2Qea201
– FACTION Art Projects announce New York solo show of Cuban painter Armando Mariño
https://bit.ly/2EIKkgh
– Naif Painters of Santiago de Cuba for Environmental Care
https://bit.ly/2wfylBr
– Swann Sets Record for Cuban-American Painter Emilio Cruz
http://www.artfixdaily.com/artwire/release/1219-swann-sets-record-for-cuban-american-painter-emilio-cruz
Hi,
Now I understand what you mean, but please notice that our theme search from will search the words that you have in your website not the links that are set on posts/pages and is look like you have set some external links in your website, like those from this sidebar https://www.screencast.com/t/BHLV6R5Rb -> https://www.screencast.com/t/9ZIATyHMn when you search after some words the you’ll get those words in our result too.
If you want you can try this using a default theme from WordPress and you’ll see that the results are the same.
Thank you for your understanding!
Calin,
Thanks for pointing that out.
Could I modify the searchform.php file to include only Posts or specific Post Categories?
Perhaps by adding the following ‘hidden’ input to the file?
Something like these:
– <input type=”hidden” name=”post_type” value=”post” /> –
– <input type=”hidden” name=”cat” id=”cat” value=”2,28,29,30,31,32,33,38″ /> –
This is the current searchform.php with the new line included:
<form method=”get” class=”td-search-form-widget” action=”<?php echo esc_url(home_url( ‘/’ )); ?>”>
<div role=”search”>
<input class=”td-widget-search-input” type=”text” value=”<?php echo get_search_query(); ?>” name=”s” id=”s” />
<input type=”hidden” name=”post_type” value=”post” />
<input class=”wpb_button wpb_btn-inverse btn” type=”submit” id=”searchsubmit” value=”<?php esc_html_e(‘Search’, ‘newspaper’)?>” />
</div>
</form>
-
This reply was modified 7 years by
blukid.
Hi,
Yes, you can limit the search results, but this can be achieve only with custom work, unfortunately we can not offer for the moment custom work ( Support Policy ), sorry!
Here are some reference, maybe this will help you to achieve what you need.
-> https://wpsites.net/wordpress-tips/exclude-pages-posts-categories-from-search-results-in-wordpress/
-> https://www.wpbeginner.com/wp-tutorials/how-to-limit-search-results-for-specific-post-types-in-wordpress/
-> https://www.wpexplorer.com/limit-wordpress-search/
Hope this will help you!
Thanks.
Hi,
The page results from search if you are using tagDiv Composer is this one -> wp-content/plugins/td-composer/legacy/Newspaper/search.php and the search box can be found in -> wp-content/plugins/td-composer/legacy/Newspaper/parts/page-search-box.php
-> https://www.screencast.com/t/cemSP0GQ7Frj
Thank you!
Hello,
There are a few files that need to be edit, depend on the search element that you are using.
Search form -> wp-content/plugins/td-cloud-library/shortcodes/search/tdb_search_form.php
Widget search -> wp-content/plugins/td-composer/legacy/Newspaper/parts/page-search-box.php
Widget search -> wp-content/plugins/td-composer/legacy/Newspaper/searchform.php
Header live search -> wp-content/plugins/td-cloud-library/shortcodes/header/tdb_header_search.php
-> wp-includes/general-template.php
Thank you!