• Paul

    (@pawelszroeder)


    Hello, I have few questions about how WP works with files in media library.

    I have a private WordPress page where I’ve added some PDF files. Will these files be indexed by bots to search engines? Files were added to the media library.
    After a month I found out that Google show links to all my pdf files. How could this happen? I didn’t attach files elsewhere. I know how to remove it from the Google index, but I don’t know how these files were added to it.

    I read that every file from the Media library can be indexed by Google / Bing, even if it is not connected to any page. Is it true?

    So even if files is added only to private page it can be still indexed?

    How does it work?

    • This topic was modified 1 year, 9 months ago by Paul.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi, a private page is not the same as a private site; so yes: Google can index it, even it is indeed not connected to a page. But only if you allow them to index it; standard WP or activated in the SEO plugin.

    Do you have a SEO-plugin installed? For example: in Yoast SEO the indexing of “Media Pages” is deactivated by default (under settings / advanced)
    You can run this google search quary to see what pdf’s are indexed:
    site:yoursite.com filetype:pdf

    @pawelszroeder to not index the PDF file, you can add the following code in .htaccess file

    Note: This is for Apache server
    
    <Files ~ "\.pdf$">
    Header set X-Robots-Tag "noindex, nofollow"
    </Files>  
    
    Note: This is for Ngnix server
    
    location ~* \.pdf$ 
    {
    add_header X-Robots-Tag "noindex, nofollow";
    }

    Thread Starter Paul

    (@pawelszroeder)

    @sonalithakkar thanks, but I didn’t ask how to block pdf files from index. I just want to know how it works with default WP mode in private pages without adding extra codes ??

    • This reply was modified 1 year, 9 months ago by Paul.

    @pawelszroeder if the page is private so that page will not be indexed by google but not sure with the files as it is coming from media library, so it may get index, you can use this plugin https://www.ads-software.com/plugins/prevent-direct-access/ or All in one SEO to restrict the images/pdf from indexing.

    Thread Starter Paul

    (@pawelszroeder)

    @sonalithakkar the problem is, that no one knows how it works with files from media that were added to private page ??

    The private page hasn’t really got to do with it. It can be picked up by Google anyway via the sitemap. For example if you have activated the media in Yoast SEO; then you’ll get a media-attachment element in the sitemap.xml file. That’s why it standard off.

    Thread Starter Paul

    (@pawelszroeder)

    @davelo thanks, my private page is restricted with a password and has set nofollow, noindex. I have Yost installed, but there is no option to set noindex to files/media. There is only the option to disable attachment pages and this is something different.

    Then i don’t have any more ideas. ?? Maybe a good idea to ask support at Yoast; cause if that setting is switched off; it then shouldn’t indeed be indexed by Google.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Media library files urls in search engine’ is closed to new replies.