Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Add Audio Files and Create Playlists in WordPress

Do you want to add audio files to your WordPress site? As a content management system, WordPress is capable of handling audio files by default. However, many beginners are not aware of this. In this article, we will show you how to add audio files and create playlists in WordPress.

An audio playlist in WordPress

Supported Audio File Formats in WordPress

WordPress uses HTML5 audio tag to embed audio files. It is compatible with most modern devices and works particularly well for mobile devices. HTML5 audio tag supports MP3, OGG, and WAV file formats.

MP3 is the most commonly used and widely supported format for audio files, and we recommend you to use it whenever possible.

Video Tutorial

Subscribe to WPBeginner

If you don’t like the video or need more instructions, then continue reading.

Adding a Single Audio File in WordPress

Adding a single audio file or music track to any WordPress post or page is very easy. Simply click on the add media button on the post edit screen.

Adding an audio file in WordPress post using media uploader

Next, a media uploader popup will appear on your screen. You need to click on the upload file button to select and upload your audio file. Once it’s uploaded, you need to click on insert into post button.

WordPress will insert your audio file in the post. If you are using the visual post editor, then you will be able to see the file embedded into your post. If you are using the text editor, then you will see the audio shortcode.

Single audio file embedded into WordPress visual editor

You can continue editing your post, or save and publish it. Once published, you can preview your post where you will see your audio file embedded like this.

A single audio file added in a WordPress post

Another easier way to add a single audio file is to upload the file to the media library. After that simply copy the file URL and paste it in the visual editor.

WordPress will automatically embed the URL for you. This is similar to how you embed videos in WordPress where you just paste the URL of a YouTube video and WordPress automatically embeds it.

Adding Audio Playlist in WordPress

Just like image galleries, you can also add audio playlists to your WordPress posts using the media uploader. Simply click on the add media button to upload your audio files.

After uploading your audio files, you need to select the files you want to include in the playlist and then click on create new playlist link in the left hand column.

Creating audio playlist in WordPress

You can now drag and drop to rearrange songs in the playlist. You can also enable the display of track name, artist name, and image. This information is embedded with your MP3 file’s IDT meta tags and is automatically displayed by WordPress.

Playlist Settings

Once you are done, simply click on the insert audio playlist button. Your playlist will be added to your post, and you will be able to see it in visual editor. You can now save your post and preview your playlist.

An audio playlist embedded in a WordPress blog post

Editing Meta Information of Audio Files in WordPress

WordPress can automatically get the meta information from your MP3 file. However, if your file does not have any meta information, or you would like to change it, then you can do so in the media uploader.

Click on the Add Media button to launch the media uploader. You can upload your audio file or if you have already uploaded the audio file, then click on it in the Media Library.

Once the audio file is selected, you will notice the attachment details column on the right. This is where you can provide track title, artist name, album name, caption and short description for the track. This information will be displayed in the playlists and on single attachment pages.

audio-meta-info

If the audio file you uploaded has an embedded image to be used as album cover, then this image will be automatically extracted by WordPress. It will be stored in your media library and will be used when this track is added to a playlist.

However, if your audio file does not have a cover image, then you can edit the file in WordPress and upload an image. Simply go to Media » Library select the file you want to edit and click on the edit link below it.

Editing an audio file in WordPress

If you are viewing the media library in grid view, then clicking on the audio file will open a popup. You can click on the Edit more details link at the bottom of the popup to edit the file.

Edit more details link

You will now reach the edit media page, where you can not only edit all the meta information for your audio file, but you can also upload a featured image. This image will then be used when the audio file is added to a playlist.

Uploading album cover image by editing media file in WordPress

Adding Audio Files and Playlists to Sidebar Widgets

By default WordPress does not automatically embeds audio file URLs. First we need to enable automatic embedding for text widgets, and then we need to enable shortcodes. Simply paste this code in your theme’s functions.php file or a site-specific plugin.

add_filter( 'widget_text', array( $wp_embed, 'run_shortcode' ), 8 );
add_filter( 'widget_text', array( $wp_embed, 'autoembed'), 8 );
add_filter( 'widget_text', 'do_shortcode');

Now you can upload a file to the media library and copy its URL. Add a text widget to WordPress sidebar and paste the URL inside it.

WordPress will automatically embed the URL into media player to play your audio file.

To add a playlist, you will need to use shortcode [playlist] with the IDs of media files you want to include into the playlist.

First you will need to upload the audio files you want to include in the playlist by visiting Media » Add New.

Now you need to edit each audio file you want to add in the playlist. Simply click on the edit link below the file in media library or click on edit more details link if you are viewing media library in the grid view.

On the Edit Media page, you will get the media file ID below the title field.

Getting the media file ID in WordPress

Now that you have the IDs of the file you want to add into the playlist, you can use the shortcode like this:

[playlist ids="14,24,36"]

Don’t forget to replace the ids with your own file IDs. You can use this shortcode in a text widget. This is how it looked on our test site:

Adding an audio playlist in WordPress sidebar widget

We hope this article helped you learn how to add audio files and create playlists in WordPress. You may also want to take a look at our guide on how to start a podcast with WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

69 CommentsLeave a Reply

  1. Rachel E

    Do you recommend optimizing audio files to minimize file size, like is recommended for images?

    Thanks for another informative article!

    • WPBeginner Support

      We would not normally recommend hosting audio or video on your site and instead embed it from another service but if you do plan to upload the files to your site you would want to optimize them for reduced file size.

      Admin

  2. Afaque

    The above screenshots of the wordpress are very old. unable to add playlist in new wordpress interface.

    Can you please guide how to add playlist and also guide, how to allow users to select their own playlist in the wordpress?

    • WPBeginner Support

      This article was last updated in 2015, we’ll be sure to look into updating this article once we are able :)

      Admin

  3. Danica

    This doesn’t work now? Whenever I upload an mp3 single file less than 5mb in size, it says “Sorry, this file type is not permitted for security reasons.”

    How do I fix this?

  4. Joey

    As of Wordpress 5.4, single songs work but I don’t think you can do playlists (unless I’m missing something). I’m guessing it can still be done with HTML though, but an external embed like Sound Cloud might be easier. Just posting this in case someone else is having trouble finding how to make a playlist, so you don’t waste your time.

    • WPBeginner Support

      Correct, at the moment there is not a playlist block with the block editor, we will be sure to take a look for what we can update with for other options.

      Admin

  5. Tianna

    Is it possible to have a playlist on my home page
    I have created it on a new page and it works great just what i want for the home page but can’t seem to make that happen.
    THANKS FOR ANY HELP

    • WPBeginner Support

      It would depend on your specific theme and if you’re using a static homepage, otherwise you would need to add the playlist to a widget

      Admin

  6. Anna

    Thanks a lot!
    It’s a very useful article.

    • WPBeginner Support

      You’re welcome :)

      Admin

  7. naijahot

    how can I upload music for people to download e.g if I upload music once my visitor click download it will start downloading

  8. taylor holden

    I’ve done all this but my files don’t show attachment_id. its just the file name as i’ve saved it.

    what i was hoping to do was to have a page with lecture notes by topic and this doesn’t seem to work.

    any ideas or am i doing it wrong. no issues adding to the functions.php but i haven’t added a text widget because i don’t want to see the widget on every page.

  9. Cliff

    I am able to insert an audio file into a post using your above method. It is in a Wav format. However, the audio file will not play in preview. Do I have to actually publish the post for the audio to play?

  10. Yesenia Latorre

    Hello, I figured out how to add the audio file to both, a post and Footer 1, I actually like it better at the bottom of the page, it was pretty easy to upload, it’s about 3 minutes of a song, however, like your photo above it shows 00:00 and I published it and when i press play, it wont? help? Also, this is my first site, so I haven’t launched it yet, does that have anything to do with it? Also can i make it play automatically whenever someone visits the site?

  11. Natasha Lane

    Hello,

    I keep following this method to add my audio but it only becomes available as a download and can’t actually be played on my site. Can you tell me why this is?

    Thanks in advance.

  12. Natasha D. Lane

    Hey, there! I’m an author who is trying to add a short audio recording of my book under each description. I’ve followed the tutorial but the audio player doesn’t pop up. Instead the link just becomes downloadable.

    How can I fix this?

    Thank you.

    • WPBeginner Support

      Hi Natasha,

      Your audio clip needs to be in supported format MP3, OGG, and WAV file formats.

      Admin

      • Lynne

        Great tutorial. Followed it to a “T,” however, files will not load. The files are compatible as they are MP3, and they worked back when I started up my website. Now there is a 2MB limit. Any ideas? All songs are longer than 2MB. It will work in a post, but not as this suggests in a media library. I have not tried a widget playlist as I thought it would do the same. Have tried from both URL and selecting files, but as stated the limit prevents me from adding anything. TIA.

  13. April Perez

    I need to add a playlist to my website. I am a DJ and need to have brides and friends access playlist and put songs and artists as well as be able to add MP3 files on the list if needed. I need it to be specifically accessible to each party separately. I am not sure which plug in is best. I use WordPress regularly for my website. Can you advise?

  14. Casey

    What size should the photo be set to so you can see it with correct aspect ratio? It’s only showing me the top 1/3 to 1/2 of my photo.

  15. Marcio Motta

    I have a blog with a considerable number of visitors and would like to make available an audio version of the posts, that is, all the posts would be reproduced, also, in audio.
    My question is whether this could be characterized in duplicate content for Google.
    Thank you for your response.

  16. Kumar saptam

    How to increase the loading media size from 2mb to 10000mb

  17. Christian Wameh

    Very good tutorial but i want to know if it is possible to add “download” button on single song and how.

  18. joel

    I got watched many tutorials on how to add audio and create playlist but I can’t find a tutorial/lesson on how to add download option in the playlist.

  19. Jesse

    I want to create a playlist as a widget, but the permalinks for my audio files are showing as the artist/song names, not as attachment ids with numbers. Therefore when I want to create a playlist made up of song ids, I’m not sure how to do that. Is there a way to change this or get the id that I’m not seeing?

  20. Randy

    I host a weekly radio show. For the time being I am using HTML tables to create my playlist. Is there an easier less time consuming way to do this? My radio shows are on my hosting site in mp3 format. Any ideas would be greatly appreciated!!

    I use Google sheets to write out my playlist for a given show and then use the online tool tableizer to convert the text to table. Then I take that code and paste it to my WordPress page. I go through a lot of steps and would love to simplify this process.

    Thanks!!!!

  21. Alison

    Hello, I’m trying to add an audio playlist (mp3 files) to my homepage in a widget and I’m not able to. I have the Maxwell template. Does this template allow for this function? When I download music files, the “Create Playlist” function doesn’t appear. I’ve also tried installing the Cue plugin, which allows me to put a playlist on a post or a page, but not in a widget on the static homepage. Thanks for any help!

  22. Prosper Ezenwa

    Any idea on what could cause music to play when clicked on the download link instead of downloading?

  23. zee

    i have put the audio file. But, how do i make it downloadable to the public instead of streaming?

  24. John Stephens

    This tutorial was awesome. The mp3 file works great on my post page. However it doesn’t work on my site when accessed by an android phone or tablet. It does nothing when clicking the start button, any suggestions?

  25. Steve

    Hello, can I display the music with a different appearance? Bigger buttons to manage the songs. Another music theme.

  26. francesca

    hi there,
    is it possible to have one song playing in the entire website, that doesn’t stop and start again the minute I navigate it?

    thanks in advance for your reply! :)
    have a nice day
    best
    francesca

  27. Asif

    Can shared hosting take the load of music playbacks from website?

    • WPBeginner Support

      A couple of music files not accessed by many users at once will be fine. However, if you are getting many visitors and have multiple music files, then you will need to upgrade your hosting to managed WordPress hosting.

      Admin

  28. Sergio

    I added a playlist with the sidebar widget but it only shows on computer not on phones or tablet

  29. Jill Bedford

    Is it possible to embed an audioboo link in the free version of wordpress? This is for a not for profit organisation. many thanks
    Jill

      • Jill Bedford

        Thanks – is it possible to add video files to a free version of Wordpress? Using the theme Twenty Thirteen.

      • Jill Bedford

        …or embedding links to ‘audioboo’ – an audio recording platform in the free version of Wordpress….?? Not an audiobook – although that sounds cool!!!
        Thanks, Jill

  30. Ed Smith

    Is there a way to share this audio on social media such as Facebook or Twitter, etc?

  31. Melissa

    I’m never listening to what WP Beginner says again. I was trying to add a code for different music player as the one I have doesn’t do playlists. It says Wordpress can do it itself, so I added what it said where it said and the following happened.

    Adding Audio Files and Playlists to Sidebar Widgets is the bit I added. Now I get this error when trying to do anything on my site

    Parse error: syntax error, unexpected ‘add_filter’ (T_STRING) in /home/user/public_html/example.com/wp-content/themes/mystore/functions.php on line 365

    Just copy and paste that code into the functions.php you said. Great, THANK YOU VERY MUCH.

    • WPBeginner Support

      Hi Melissa,

      Please see our guide on how to fix syntax error in WordPress. You may also want to see our beginner’s guide on how to copy paste code in WordPress.

      The error you are seeing indicates that in your WordPress functions there is an unclosed statement before add_filter at line 365. Probably just a missing semi colon. You can easily fix that by editing your functions file using an FTP client or file manager in your hosting control panel.

      Admin

  32. marcos ferreira

    Thank you for sharing this video. It was very helpful

  33. Mark Bigland-Pritchard

    I just tried to add 4 audio files to the media library for our site and was refused. It gave a list of acceptable file types, none of which is audio.

  34. Aragon

    HI, is there any way that we can sort the songs in the playlist based on number of views

  35. Shirley

    I created this audio play list. Love it. They are fine on website. BUT just found out that they keep looping the first section of audio files when playing on ipad and iphone. Please guide.

  36. Cristian Balan

    Is there a way to create a Playlist using external (remote) mp3 files?

  37. Kevin Gilbert

    I know how to embed the audio player for one song, and then edit it to provide both an mp3 and an ogg file so that the right one plays based on the visitor’s browser. Does anyone know if that’s doable when you’re creating a playlist? I can’t seem to find whether that’s possible or not, and how to do it.

  38. Jesse Cann

    Is there a way to have the mp3 set to autoplay and to loop when the page is uploaded? Thanks.

  39. Juksaa

    How can i add one playlist from own map of my sites ftp, not via media upload to wp?
    how can i play one map, how is link?

  40. eraxe

    Nice article everything works.

    So I’d like to know if you have an idea how to make the audio files downloadable, probably to insert a download button along the playlist for each track?

    Thanks

  41. Chris Mueller

    It seems that every time I create a playlist, the audio files can be easily downloaded by users. In the video, it appears that the songs are not downloadable by the viewer. Could someone offer assistance in making these audio files non-downloadable?

    • Sem

      I have the same problem!
      The playlist shows on the website’s page not with the possibility to play it but download it.
      How can I fix it ?
      Thanks

  42. Angela Bowman

    Hi, I have definitely used this approach in the past. I am migrating a client from Host Gator to WP Engine and realized they have over 1GB of audio files they are hosting (and streaming of course) on their site. This is a huge bandwidth issue, as you can imagine. Not that the files are access frequently, but it occurred to me that self hosting audio may be just as bad as self hosting video.

    In the past, I’ve hosted the files on Amazon S3 account instead and used an audio streaming plugin to fetch those files. I think that would be a better solution to avoid download/bandwidth issues on the web host.

    However, I’m wondering if an even better solution is to host and stream the files via SoundCloud or similar service, then embed the SoundCloud file on the website?

    I’m trying to assess what is going to allow best performance, reliability, and least bandwidth hit to the WP hosting account.

    Thanks!

  43. erase

    Take Note: anyone trying to do this, shouldn’t copy and paste the ‘play list’, code rather manually retype it to your own website because the quotation mark here seems to produce a False result. Thank You, it works.

  44. emeka nkeze

    Love this tutorial. Thanks for sharing. What about adding a playlist from soundcloud or other media sites like hulkshare and reverbnation??

  45. Emily Barney

    Any guidance on what audio files you can post and which you shouldn’t for copyright reasons? Even some links would be useful.

    It’s very easy to upload files, but it’s also very easy for artist / label / copyright holders to submit a DMCA Takedown notice to your ISP (internet service provider) or hosting service:

    • WPBeginner Support

      As a general rule of thumb, you should not upload audio files containing the works that you haven’t created yourself. You can create and upload your own audio files, or the audio files that are currently in public domain.

      Admin

  46. Alpha

    Great post! Thanks you so much!
    I Have embedded different streaming radios in my site. Selecting them one by one they all play simultaneously. Is it in Wordpress a way to automatically close the playing radio on selecting a other one?

  47. Peter

    Any plug-in suggestions for situations with large size MP3 files that are too big to upload into the Media Library. Rather than music, these are educational lectures. Files sizes around 40 – 45MB

    • Kevin Gilbert

      Peter, Ask your host to increase your file size upload limit for WordPress. If they won’t or can’t, and it’s something you really need, you might want to change hosts. For one of my client’s sites on WPEngine, they’ve increased our upload size to 200MB. Once a year, we upload about 10 audio files from a conference, and we needed the additional file size settings because the files are usually of one-hour talks, so they’re larger than just your typical audio song file.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.