How to avoid to be indexed by Google and to have pages such as (see example)

Posted in: Newspaper
Post count: 11

Hi, I’ve just published a website based on newspaper theme and I’ve noticed that all the images appears on the search engine as a page (e.g https://www.marraiafura.com/supermercato/ or https://www.marraiafura.com/35/ and so on…). I’d like to avoid to have this pages from image (instead of the regular image link, of course e.g. https://www.marraiafura.com/wp-content/uploads/2009/12/supermercato.jpg and https://www.marraiafura.com/wp-content/uploads/2009/12/35.jpg ) and/or avoid at the same time to see them indexed on search engines.
Thanks a lot

Post count: 23312

Hello mf_srls,

Unfortunately, please notice that cases are not controlled by our theme, sorry! You need to check some online solutions because we cannot provide support for that cases, sorry! Also, you can check more details about this case, here -> http://www.robotstxt.org/robotstxt.html -> https://www.wpbeginner.com/wp-tutorials/how-to-optimize-your-wordpress-robots-txt-for-seo/

Thanks for your understanding!

Post count: 11

Actually, I’ve found a solution that maybe could useful even for other users.
A simple function can be added to functions.php file, a kind of

add_action(‘wp_head’,’SOFT_manage_robots’);
function SOFT_manage_robots(){
if(is_singular(‘attachment’) )
$html= “<meta name=\”robots\” content=\”noindex,follow\”>”.PHP_EOL;
echo $html;
}

Obiouvsly it’s better to do before a child theme.

Post count: 35449

Hi,

Thank you for sharing the solution you’ve found with us.

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.