How to Add an Audio Player to a WordPress Site
You can add a WordPress audio player without installing anything. The built-in Audio block handles most single-file needs, while shortcodes, embeds and plugins cover playlists and hosted shows. This guide shows which option to use and how to set it up.
Which method should you choose?
| Your goal | Best option |
|---|---|
| Play one file in a post | Audio block |
| Place a player in classic content or a template | Audio shortcode |
| Show several tracks from your Media Library | Playlist shortcode |
| Publish a show from a podcast or music platform | Platform embed |
| Sell audio, or add custom player designs | Dedicated plugin |
Method 1: Use the Audio block
- Open a post or page in the block editor.
- Click the block inserter and choose Audio.
- Upload a file, choose one from the Media Library, or insert a URL.
- Add a caption if it helps visitors understand the recording.
- Preview the page and test playback on a phone.
The block settings let you turn on looping and choose how the browser preloads the file. Leave autoplay off: browsers commonly block audio with sound until the visitor interacts with the page, and unexpected sound is disruptive.
Method 2: Use the audio shortcode
The shortcode is useful in the Classic editor, widgets and other places that process shortcodes:
WordPress supports MP3, M4A, OGG, WAV and FLAC with this shortcode. MP3 is the safest default for broad browser support.
Method 3: Create a playlist
To show several uploaded tracks in one player, use the playlist shortcode with the attachment IDs from your Media Library:
Method 4: Embed a hosted player
If your audio already lives on a platform, paste the public link into the editor or use that platform’s embed code. Hosted players save bandwidth and often include statistics, but they add third-party code and may set cookies. If you add one, update your privacy policy.
When a plugin makes sense
Consider a plugin only when you need something WordPress does not provide, such as a sticky player that continues across pages, audio sales, or advanced design controls. Before installing one, check its last update, compatibility with your WordPress version, and support history.
Before you publish
- Compress long recordings. Spoken audio usually does not need a very high bitrate.
- Check that the file does not exceed your site’s upload limit.
- Use a descriptive file name and a clear caption.
- Add a transcript for spoken content.
- Test seeking. If it fails, see our web audio FAQ.
Next, compare other ways to embed audio on a website.
