Keyword

Noindex page result

  • Wilfried
  • Wilfried's Avatar Topic Author
  • Offline
  • Junior Member
More
3 years 11 months 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.

More
3 years 10 months ago #177739 by JoomlaWorks
Replied by JoomlaWorks 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.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Wilfried
  • Wilfried's Avatar Topic Author
  • Offline
  • Junior Member
More
3 years 10 months 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