Shortcodes

[wpdm_direct_link] – Create a Direct Download Link

1 min read Updated Jan 26, 2026

The [wpdm_direct_link] shortcode creates a simple text link that triggers a download when clicked. Unlike other shortcodes that display package information, this creates a minimal inline link.

Basic Syntax

[wpdm_direct_link id="123"]

Parameters

ParameterTypeRequiredDefaultDescription
idintegerYesThe package ID
labelstringNoDownloadLink text displayed to users
targetstringNoSet to _blank to open in new tab
classstringNoCSS class names for styling
eidstringNoHTML element ID attribute
stylestringNoInline CSS styles

Usage Examples

Basic Link

[wpdm_direct_link id="42"]

Output: Download

Custom Label

[wpdm_direct_link id="42" label="Get the PDF"]

Output: Get the PDF

Open in New Tab

[wpdm_direct_link id="42" label="Download Now" target="_blank"]

Styled Link

[wpdm_direct_link id="42" label="Download" class="btn btn-primary" style="font-weight: bold;"]

Inline in Text

Perfect for embedding downloads within paragraphs:

You can [wpdm_direct_link id="42" label="download the user guide"] to learn more about the features.

Tips

  • This shortcode respects all package access controls (roles, locks, etc.)
  • If the user doesn’t have access, the link will redirect to the package page to show unlock options.
  • Use the class parameter to apply button styles from your theme.

Related