Make digital download unindexed in google

Hi Gurus,

I just did a search of google and found that the ebook I’m trying to sell on my site, is completely exposed through google search. How is that possible exactly?

What do you recommend I do to hide digital downloads from google indexing?

Thanks kindly,

  • Adam Czajczyk
    • Support Gorilla

    Hello Emilio,

    I hope you’re well today and thank you for your question!

    If your site is “open for indexing” (“Discourage search engines from indexing this site” option on “Settings -> Reading” page disabled) that may happen as WordPress is not rejecting search engines’ crawlers from checking the site.

    I assume that the e-book file has been uploaded to the Media Library of your site, is that correct? Is the e-book file indexed itself or some attachment page then? I’m asking in order to find a way to prevent further unauthorized access to the file so let me know please.

    As for de-indexing. The simplest way would be to… remove the file from Media Library and upload it again. That would make that already indexed file unavailable so 1) nobody could download it from these indexed links 2) search engines would remove that “broken” link from index over time.

    Best regards,


  • emilio_gagliardi
    • The Incredible Code Injector

    Hi Adam,

    Thank you for replying.

    So, I didn’t actually upload the .pdf through the library. I created a separate directory in “Uploads” and uploaded the file through ftp.

    When I created the product in MarketPress and it asked for URL, I manually typed the URL to the file in the field. I just double checked, and the .pdf isn’t in the Library.

    See the path to the file below:

    I would like to lock down the entire “courses” directory, but I’m not entirely sure how to do that and still make those files accessible for digital downloads.

    I haven’t created any posts that contained the URL. I just changed the URL to the .pdf.

    Should I upload the file through the WP Media Library? Would that allow me to secure it better? What do you do if your digital download is bigger than your upload limit?

    Thanks kindly,

  • Adam Czajczyk
    • Support Gorilla

    Hello Emilio!

    An upload file size is relatd to PHP settings and you can increase it either by changing the “upload_max_size” and “post_max_size” option via PHP settings in cPanel (if available) or one of the ways described in this article:

    Getting back to the initial issue. If it’s outside Media Library, that’s fine. I referred to the Media Library because that’d be the most common case but nothing stands in a way to keep these files in a separate folder.

    In that case I’d go for a following solution:

    1. Rename the “courses” folder to some other name and update your download links in store accordingly;

    this will make files unavailable via existing/indexed links and cause search engines to de-index them over time

    2. Create a “robot.txt” file in the root folder of your site (WP installation) putting following code inside:

    User-agent: *
    Disallow: /my_courses/

    where “my_courses” should be replaced with a new name of “courses” directory;

    3. Additionally, you may create an empty “index.php” file inside the folder where the files are kept (“my_curses”:wink: to prevent basic file listing (that way is used all over the WP installation folders)

    4. Our Defender plugin also has an additional “Hardening” feature that prevents directory indexing/listing you may want to use it in addition (not instead in this case though) to the above methods. You’ll find Defender here:

    Then, after all these steps are completed, you might want to “speed up” file de-indexing by following this guide:

    Best regards,


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.