WP Media Player Shortcode Reference
WP Media Player registers two shortcodes: [wp-media-player] for embedding a single video or audio player, and [wpmediaplayer_timestamp] for creating clickable timestamps that jump the player to a specific moment. Both work in posts, pages, widgets, and any template that processes shortcodes.
[wp-media-player]
This is the main embedding shortcode. It accepts five attributes. The id attribute is the only required one.
- type: The kind of embed. Use
mediafor a single video or audio item. Useplaylistfor a playlist ID — this requires Pro. Defaults tomedia. - id: The media item ID from the Media tab. This is the only required attribute. Without it the shortcode returns nothing.
- autoplay: Override the per-video autoplay setting for this embed only. Accepts a truthy value. Leave empty to use the saved setting.
- poster: Override the thumbnail or poster image URL for this embed only. Leave empty to use the saved poster.
- layout: Override the playlist layout when
type="playlist". Used with Pro playlists only.
A minimal working example:
[wp-media-player id="123"]
With overrides:
[wp-media-player id="123" autoplay="true" poster="https://example.com/poster.jpg"]
The shortcode renders a <media-player> custom element (Vidstack) with all settings — preset, branding, chapters, layers — applied from the media editor. Any attribute you pass here overrides the saved value for that one embed only; everything else comes from the media item’s configuration.
[wpmediaplayer_timestamp]
This shortcode creates a clickable link that jumps the nearest WP Media Player on the page to a specific timestamp. Use it inside post copy to link to chapters, highlights, or key moments.
- time: The target time in
HH:MM:SSorMM:SSformat. This attribute is required. - media_id: The media item ID the timestamp belongs to. This attribute is required.
Example:
[wpmediaplayer_timestamp time="02:30" media_id="123"]Introduction[/wpmediaplayer_timestamp]
The text between the opening and closing shortcode tags becomes the link label. When a viewer clicks it, the nearest player with a matching media_id seeks to 2 minutes and 30 seconds.
Where to Find the Media ID
The media ID is shown in the first column of the WP Media Player > Media list. You can also find it in the URL when editing a media item — the URL ends with id=123. Copy it from either place and paste it into the id attribute of the shortcode.
Override Behavior
Shortcode attributes take priority over the media editor settings, but only for that single embed. The hierarchy is:
- Shortcode attribute: Highest priority
- Per-video media editor setting: Medium priority
- Global default from WP Media Player > Settings > General: Lowest priority
This means you can use one global preset for most videos and override individual embeds without opening the editor.
Using Shortcodes in Templates
If your theme or page builder does not process shortcodes in a particular context — for example, a widget area or a custom field — wrap the call in PHP:
<?php echo do_shortcode([wp-media-player id="123"]); ?>
For timestamps:
<?php echo do_shortcode([wpmediaplayer_timestamp time="05:00" media_id="123"]Key Moment[/wpmediaplayer_timestamp]); ?>
Next Steps
Shortcodes give you the most control over individual embeds. For embedding without shortcodes, see how to use the WP Media Player Gutenberg block, or for a complete walkthrough of adding your first video, start with how to add your first video.