🤑 Get MainWP Pro LIFETIME license for only $399 $499.                

Useful Code Snippets for the Download Monitor Plugin for WordPress

Download Monitor WordPress Plugin

If you use the Download Monitor plugin on your site to manage downloads and uploads, you can control its options using code snippets.

Download Monitor WordPress Plugin

Download Monitor WordPress Plugin

The Download Monitor WordPress plugin supports multiple versions of the same file, as well as being able to insert downloads into posts, log and track downloads and for being able to sell downloads on your site.

To disable the force download, use this code snippet;

add_filter( 'dlm_do_not_force', '__return_true' );

By default, the Download Monitor plugin for WordPress will redirect empty downloads to the site’s homepage.

To disable the empty redirects for download, use this code snippet;

function dlm_disable_empty_download_redirect( $b ) {
return false;
add_filter( 'dlm_empty_download_redirect_enabled', 'dlm_disable_empty_download_redirect' );

To change the empty redirects for downloads from the homepage, you can use this code snippet and change the redirect URL as needed;

function dlm_custom_empty_download_redirect_url( $s ) {
return site_url('no-access');
add_filter( 'dlm_empty_download_redirect_url', 'dlm_custom_empty_download_redirect_url' );

MainWP offers a solid code snippets extension that will allow you to deploy and enable code snippets to all connected Child Sites.

Being able to control parts of Download Monitor using code snippets will allow those changes if needed to be made to all Child Sites that are connected to your MainWP dashboard.

Useful Links

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Looking for something?

Privacy laws apply to businesses that collect personal information. Since no personal information is collected by the MainWP plugins, no privacy laws apply to the MainWP plugins. This includes GDPR, UK DPA 2018, PIPEDA, Australia Privacy Act 1988, LGPD, PIPL, and other privacy laws.
Donata Stroink-Skillrud
Donata Stroink-Skillrud
President of Agency Attorneys