WP-DownloadManager
WP-DownloadManager

WP-DownloadManager

4/5 (37 ratings) 3K+ active installs Updated Aug 10, 2026
Downloads, every file with its size, its hits and who is allowed to take it

Downloads, every file with its size, its hits and who is allowed to take it

WP-DownloadManager keeps a library of downloadable files, counts how often each
one is fetched, and gives you a downloads page, a feed, a widget and a shortcode
to put them in front of your readers. Files can live in a folder on your server
or anywhere else on the web, and each one can be limited to a role.

Features

  • A downloads page with categories, search, sorting and paging.
  • A [download] shortcode, plus a button on both the Visual and Text editors.
  • Per-file permissions, from everyone down to administrators only.
  • Local files, uploads and remote URLs in one library.
  • A downloads RSS feed.
  • A widget for most downloaded, recent downloads and downloads by category.
  • Every piece of markup is a template you can edit.

Donations

I spent most of my free time creating, updating, maintaining and supporting
these plugins, if you really love my plugins and could spare me a couple of
bucks, I will really appreciate it. If not feel free to use it without any
obligations.

Usage

  1. To embed a specific file to be downloaded into a post/page, use [download id="2"] where 2 is your file id.
  2. To embed multiple files to be downloaded into a post/page, use [download id="1,2,3"] where 1,2,3 are your file ids.
  3. To limit the number of embedded downloads shown for each post in a post stream, use the stream_limit option.
    1. Example: [download id="2" stream_limit="4"]
    2. This will only display the first 4 downloads for the post when rendered in a post stream, and display the full list of downloads when viewing the single post.
  4. To sort embedded downloads, use the sort_by and sort_order options.
    1. Example: [download id="2" sort_by="file_id" sort_order="asc"]
    2. This will sort the embedded downloads by file ID in ascending order.
    3. Valid values for sort_by are: file_id, file, file_name, file_size, file_date, and file_hits
  5. To choose what to display within the embedded file, use [download id="1" display="both"] where 1 is your file id and both will display both the file name and file description, whereas name will only display the filename. Note that this will overwrite the “Download Embedded File” template you have in your Download Templates.
  6. To embed files as well as categories, use [download id="1,2,3" category="4,5,6"] where 1,2,3 are your file id and 4,5,6 are your category ids.
  7. If you are using Default Permalinks, the file direct download link will be http://yoursite.com/index.php?dl_id=2. If you are using Nice Permalinks, the file direct download link will be http://yoursite.com/download/2/, where yoursite.com is your WordPress URL and 2 is your file id.
  8. The direct download category link will be http://yoursite.com/downloads/?dl_cat=3, where yoursite.com is your WordPress URL, downloads is your Downloads Page name and 3 is your download category id.
  9. In order to upload the files straight to the downloads folder, the folder must be writable by the web server. You can specify which folder to be the downloads folder in WP-Admin -> Downloads -> Settings.
  10. You can configure everything else in WP-Admin -> Downloads -> Settings, on the Settings and Templates tabs.

Downloads Page

  1. Go to WP-Admin -> Pages -> Add New
  2. Type any title you like in the post’s title area
  3. If you ARE using nice permalinks, after typing the title, WordPress will generate the permalink to the page. You will see an ‘Edit’ link just beside the permalink.
  4. Click ‘Edit’ and type in downloads in the text field and click ‘Save’.
  5. Type [page_download] in the post’s content area.
  6. You can also use [page_download category="1"], this will display all downloads in Category ID 1.
  7. Click ‘Publish’

Showing Downloads In A Block

Two blocks are available in the editor, under Widgets:

  • Download — one file or several, embedded in a post. File IDs and Category IDs in the sidebar each take one id or a comma-separated list, and between them they say everything [download] says: Show chooses between the name with its description and the name alone, and the Order panel carries the sort column, the direction and the limit that applies where the post is one of many in a stream.
  • Downloads Page — the whole library with its categories, search box and paging, the same listing [page_download] produces. Category ID narrows it to one category, and zero lists them all.

Both render on the server, so the block preview in the editor is the real listing rather than an approximation, and adding a file updates every post showing it without re-saving anything.

The shortcodes still work and are not going anywhere. [download], [download=2], [page_download] and [page_downloads] behave exactly as they always have, and a post already containing one needs no change. The blocks call the same code the shortcodes call, so the two render identically — use whichever suits the post.

There is no third block for [page_downloads]. The plural and the singular are one and the same shortcode registered under two tags, so a block for each would be one block under two names — and unlike a shortcode, a block name is written into the post and stays there. The block wraps [page_download]; the plural remains a shortcode you can keep using.

Download Stats (With Widgets)

  1. Go to WP-Admin -> Appearance -> Widgets
  2. The widget name is Downloads.

WP-CLI

wp downloadmanager list
wp downloadmanager list --category=3 --orderby=file_hits --order=desc --limit=10
wp downloadmanager get 3
wp downloadmanager stats
wp downloadmanager reset-hits 3 --yes
wp downloadmanager delete 3 --yes
wp downloadmanager delete 3 --delete-file --yes
list and `stats` report what the Downloads screen shows, including the files whose permission is Hidden — this is the library's own inventory, not what a visitor can see. Sizes are in bytes rather than the rounded units the screen prints, because a figure a script is going to compare is worth having exact.

reset-hits is the "Reset the hit count to zero" checkbox on Edit File, and touches the counter and nothing else. **`delete --delete-file` deletes the file from the server as well**, which is the checkbox the Delete File screen offers; without it only the row goes. Both ask before doing anything, so a script has to pass `--yes`.

There is no create or update: adding and editing a file offer a four-way choice of source — keep the current file, pick one already in the downloads directory, upload one, or name a remote URL — and two of those are a browser handing over a multipart body.