How can I hide media from Google

#837624
  • Resolved Sheila
    Rank Math free

    Hi,
    I have some PDF documents that are in my media location on WordPress. The media is attached to a page and I have noindex selected on the pages, but I have noticed that the media is showing up on Google. How can I stop this, and how long will it take for it to be removed from Google?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    I’m sorry to hear about the issue you are facing with your PDF documents showing up on Google search results. To prevent your PDF files from being indexed by Google, you can follow these steps:

    1. Raise a Search Removal Request:

      • Open Google Search Console and log in to your account.
      • Navigate to the "Removals" section.
      • Choose "New Request" and follow the steps to submit a removal request for the PDF URL you want to remove.
    2. Disallow PDF Files Using robots.txt:

      • Navigate to your Robots.txt file through WordPress Dashboard → Rank Math SEO → General Settings → Edit Robots.txt.
      • Add the following code to disallow PDF files:
        User-agent: *
        Disallow: /wp-admin/
        Disallow: *.pdf
        Allow: /wp-admin/admin-ajax.php
        Sitemap: https://yoursite.com/sitemap_index.xml
      • Save the changes to reflect them.
    3. Disallow PDF Files Using X-Robots-Tag (Advanced Method):

      • Modify your website’s htaccess file, header.php, or perform server-level modifications as described in the Rank Math knowledgebase article.

    After following these steps, it may take some time for Google to process the removal request and stop indexing your PDF files. The removal from the search index is temporary for a set time period, usually around six months. To permanently keep the PDF out of Google’s search index, blocking search engines from crawling the PDF using robots.txt is recommended.

    If you need further assistance or have any other questions, feel free to reach out to our support team directly here. We are here to help!

    Thank you for reaching out with your concern.

    Sources:
    Can I NoIndex PDF Files Using an SEO Plugin? » Rank Math

    Sheila
    Rank Math free

    I have read the response above.
    If I add the code using robot.txt will this impact the current files that are showing on Google and how long will it take them to be removed from Google?

    Hello,

    You may need to give Google some time to recrawl your pages and remove the form the search results pages.

    Also, you can noindex all the attachment pages from WP Dashboard > Rank Math > Titles & Meta > Attachments:

    And if you want to add the X-robots-tag to your pdf files, you can use the code given below in your .htaccess file:

    <FilesMatch ".pdf$">
    Header set X-Robots-Tag "noindex, noarchive, nosnippet"
    </FilesMatch>

    Here’s how you can edit your htaccess file using Rank Math:
    https://rankmath.com/kb/edit-htaccess/

    Looking forward to helping you.

    Sheila
    Rank Math free

    Hi. I have added the no index in settings and wondered if there is anyway that it can affect all existing media so that I don’t have to go through each PDF seperately?
    Also, can I recrawl the pages as they are being updated to prevent Google from finding them?

    Hello,

    If you use the server configuration code we shared in the previous reply it will set the response on the server when a PDF file is accessed to noindex and will prevent indexing of all PDFs while allowing other media files to be indexed.

    After adding that, you should allow Google time to de-index pages as that is an automated process but it can take weeks to be completed.

    Don’t hesitate to get in touch if you have any other questions.

    Sheila
    Rank Math free

    Thank you.

    Hello,

    We’re just following up with you to see if you have any other questions or concerns that we can assist you with. Or, if your issue has been resolved, please let us know so we can mark this ticket as closed.

    Thank you.

    Sheila
    Rank Math free

    I will implement all that you have suggested.
    Thank you.

    Hello,

    We are glad to hear that this issue has been resolved. Thank you for letting us know. This ticket will be closed now, but you can always open a new one if you have any other questions or concerns. We are here to help you with anything related to Rank Math.

    We appreciate your patience and cooperation throughout this process.

    Thank you for choosing Rank Math.

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

The ticket ‘How can I hide media from Google’ is closed to new replies.