Keyword

Noindex page result

  • Wilfried
  • Wilfried's Avatar Topic Author
  • Offline
  • Junior Member
More
1 month 1 week ago #177677 by Wilfried
Noindex page result was created by Wilfried
Hello,

In its results, Google index all my pages and also the pages with "tags" and "search results". For the fist one, I have resolved the problem. But for the second one I don' know if I can indicate somewhere to the search engine to not indexed the search results pages of the interne searchengine of my website.

Sorry for my english, I am a french dude.

Thank you.

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 10 hours ago #177739 by Fotis
Replied by Fotis on topic Noindex page result
Search results have unique URLs (which is a good thing really) as they can be both cached (on the server) and indexed by search engines.

If you want Google to discard your search results entirely, use this guide developers.google.com/search/docs/advanced/crawling/block-indexing to add a custom meta tag through the generic.php override in K2. Search results displayed by K2's search view will not be indexed after that.

For Joomla's search results view, you'll need to do the same as well. Find the relevant override and add a custom metatag.

Here's how you add a meta tag in a Joomla template override:
$document = JFactory::getDocument();
// For all search engines
$document->setMetaData('robots', 'noindex');
// For GoogleBot only
$document->setMetaData('googlebot', 'noindex');

You can even go more creative and add this in your template, albeit with a small change to only display that header when a search page is loaded.
if (JRequest::getCmd('option') == 'com_search' || JRequest::getCmd('searchword') != '') {

    $document = JFactory::getDocument();
    // For all search engines
    $document->setMetaData('robots', 'noindex');
    // For GoogleBot only
    $document->setMetaData('googlebot', 'noindex');

}

This essentially outputs the relevant meta tags for the Search component pages (com_search) as well as K2's "searchword" URL query.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Wilfried
  • Wilfried's Avatar Topic Author
  • Offline
  • Junior Member
More
3 days 11 hours ago #177913 by Wilfried
Replied by Wilfried on topic Noindex page result
Sorry for the delay of my answer Fotis.
Thank you very much. I will test all of this.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum