• Resolved napoleon1

    (@napoleon1)


    Lately all our media files have been indexed with google and even appear as snippets in google search.

    I want to no index all of our media files so that they do not appear as their own page in google but just as an image within a parent post. I have seen a number of answers to this issue but am unsure of the correct and most efficient process.

    I have already selected the option to ‘Redirect attachment URLs to the attachment itself’.

    My understanding of this is that links may still appear in google but will simply be redirected to the image. I have also read that using the above setting, the attachment URL will automatically be set to noindex and will be excluded from the site map. However, is this updated for all existing media?

    Other responses have lead me to believe I need to make additional adjustments to the settings found under the advanced gear icon in the edit media page, screenshot:

    Screen Shot 2018-05-11 at 09.57.20.png

    All of our media items currently have the same settings as those shown in the screencast above. Any advice on changes that we need to make to stop images from appearing as pages in google search would be really appreciated!

    Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • From Yoast SEO v7.0, the option redirect media (attachment) pages to the parent attached page is no longer available. If you enable the media (attachment) redirects option now using the Yoast SEO plugin, it will redirect the media (attachment) pages to the actual media files instead of the parent attached pages.

    That said if you’d like not to see all the images in the search results, you’ll first need to exclude them from the sitemap by using the following to your theme functions.php file:

    /* Remove Images From Yoast Sitemap */
    add_filter( 'wpseo_xml_sitemap_img', '__return_false' );
    

    In addition, you’ll need to either set noindex or enable the media (attachment) redirects from the Yoast SEO -> Search Appearance -> Media (tab) options.

    Once you do all this, Google will eventually drop the images from the search results. However, it will take a while and we are not sure how long it may take.

    Thread Starter napoleon1

    (@napoleon1)

    That’s great, thank you for your support. Just so that I am completely clear on the process, could you please confirm the steps below are correct:

    1) Edit functions.php file to include your supplied code

    2) SEO > Search appearance > media tab > Redirect attachment URLs to the attachment itself? > Yes

    3) Upload new site map to search console

    If we follow these steps, can you confirm that we do not need to then edit the advanced settings of each media file to change the Meta Robots Advanced to ‘no index’?

    With the above steps, our images will no longer appear as search results in a normal google search or as snippets below our main site landing page.

    One further question – will the images still be searchable in google images or with this be stopped as a result too?

    Many thanks again for your advice!

    • This reply was modified 8 years, 4 months ago by napoleon1.

    The steps you have provided are correct. Once you implement all the steps correctly, you won’t need to go through your image attachment pages manually and set noindex.

    Once you implement the provided code to disable the images in the XML sitemap, the images shouldn’t appear in any types of the Google search results. However, this will still take time for Google to remove all the images from the search results and we cannot confirm how long it would take.

    Thread Starter napoleon1

    (@napoleon1)

    Great thanks.

    As you may have realised, I am not an experienced developer. Can I copy and paste your code to the end of my functions.php file without making any further amendments? I notice there were no brackets as with other lines of code in the file i.e. { }

    Also, is there a way for the images to still appear in image search but not as their own page on normal google search?

    Thanks again!

    Plugin Support Michael Tiña

    (@mikes41720)

    If you add the above-mentioned filter to your functions.php file, then the images should be excluded from the XML Sitemap Index. However, since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes specifically. You may want to contact your developer or programmer for further assistance.

    Please refer to this KB article for more information — https://kb.yoast.com/kb/images-in-the-xml-sitemap/#image-filter

    Thread Starter napoleon1

    (@napoleon1)

    I understand, thank you for your advice.

    For my understanding, does removing the images from the XML sitemap negatively impact a websites SEO?

    • This reply was modified 8 years, 3 months ago by napoleon1.
    • This reply was modified 8 years, 3 months ago by napoleon1.

    Yes, it may negatively impact a website SEO as good images can boost organic traffic from the search results.

    Thread Starter napoleon1

    (@napoleon1)

    Ok thanks. I presume it’s not possible for the images to still rank in image results but not for their URL attachment page to list in the normal google search?

    Thread Starter napoleon1

    (@napoleon1)

    Ok thanks. I presume it’s not possible for the images to still rank in image results but not for their URL attachment page to list in the normal google search?

    Yes, the media (attachment) pages will appear in the search results if you don’t set them to noindex or enable the media (attachment) redirects.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘No index Media Files’ is closed to new replies.