WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Download Shortcode

Allows you to wrap file links in a shortcode that will force a download when clicked.

Other Notes

By default, download shortcodes work in a few specific ways:

  • If you have 'pretty permalinks' enabled via Settings > Permalinks, your links will automatically be rewritten to http://yoursite.com/download/path/__yourfile
  • If you don't include a label with your shortcode, the link URL will be displayed instead

If you wish to modify how some aspects of how download shortcodes are displayed or rewritten, there are several filters you can use to accomplish this. These should be added to your theme's functions.php file.

Filters

Use a specific CSS class to style your links

This example filter adds a class of 'downloads' to your links:

function add_download_links_class() {
    return 'downloads';
}
add_filter( 'fds_download_link_class', 'add_download_links_class' );

Disable URL rewriting even if 'pretty permalinks' are enabled

add_filter( 'fds_rewrite_urls', '__return_false' );

Change the supported directory from /uploads/ to something else

This example filter changes the supported directory to /themes/.

function change_download_files_directory() {
    return 'themes';
}
add_filter( 'fds_download_files_directory', 'change_download_files_directory' );

Please note, the directory must be located in your /wp-content/ directory.

Change the rewrite path from /downloads/ to something else

This example filter changes the rewrite path to http://yoursite.com/members/yourfile.jpg

function change_download_rewrite_path() {
    return 'members';
}
add_filter( 'fds_download_rewrite_path', 'change_download_rewrite_path' );

Requires: 3.0 or higher
Compatible up to: 3.5.2
Last Updated: 2013-2-3
Downloads: 10,780

Ratings

5 stars
5 out of 5 stars

Support

1 of 4 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1 100,1,1
100,3,3
100,1,1