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.

Have you ever linked a PDF, an mp3, image, or other kind of file because you wanted to let people download it but instead it just loads in the browser? This plugin introduces a [download] shortcode which allows you to output links that will tell the browser to download those files!

Usage

WITH 'pretty permalinks' enabled in Settings > Permalinks:

The following example would display as:

[download label="My Link"]http://yoursite.com/wp-content/uploads/my_song.mp3[/download]

The following example would display as:

[download]http://yoursite.com/wp-content/uploads/my_song.mp3[/download]

WITHOUT 'pretty permalinks' enabled in Settings > Permalinks:

The following example would display as:

[download label="My Other Link"]http://yoursite.com/wp-content/uploads/my_other_song.mp3[/download]

The following example would display as:

[download]http://yoursite.com/wp-content/uploads/my_other_song.mp3[/download]

Other Uses

If you wanted to use this in a php template, you could call something like:

<?php echo do_shortcode( '[download label="My Label"]http://example.com/wp-content/uploads/my_song.mp3[/download]' ); ?>

Important notes:

  1. If your server permissions allow it, the plugin will automatically attempt to copy force-download.php to your /wp-content/ directory.
  2. If your server permissions DO NOT allow it, you will need to manually upload the file located in /download-shortcode/wp-content/force-download.php to your /wp-content/ directory.
  3. By default, forced-download links only support files located in your uploads directory. More about this in Other Notes.

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

Ratings

5 stars
5 out of 5 stars

Support

0 of 2 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
100,1,1