• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Hide a specific download on the Easy Digital Downloads archive page

Learn in this tutorial how to prevent a download from being displayed on the Easy Digital Downloads (EDD) archive page using code.

Easy Digital Downloads displays by default all downloads you have created in the plugin on its archive page, which will be /downloads/ unless you have modified the slug following this tutorial.

A subscriber told me that she had a download that she was interested in not showing it on that page. Are you also interested? Well, here’s how to get it.

Snippet to hide a download from Easy Digital Downloads file page

Add the following code at the end of functions.php or in your functionality plugin:

To see this and another 847 code snippets of this website, login or subscribe here.

It’s as simple as that. You take advantage of the pre_get_post hook along with the conditional tags so that the download archive page doesn’t show a specific download.

In this case, the download being excluded is the one with ID 5322.

To adapt the snippet to your case, you only have to change the download ID, that you can see when you hover over the download.

Download ID

And if you want to hide more downloads, just add their ID separated by commas in the snippet above.

Conclusions

Do you want to stop showing one (or more) downloads on Easy Digital Downloads archive page? Now you know how to do it easily with code.

If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.

Benefits of being a subscriber. 🙂

CPT Easy Digital Downloads PHP

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?