Even without using plugins or having a theme with unique audio features, you can quickly embed an MP3 file to WordPress. Whether it is a song, a podcast or any other audio file, you can allow your users to play it. In the end, you can even create a simple playlist.
Yesterday, we showed you some of the best plugins for playing music on your site, and today we’re about to show you how to do the same with the WordPress’s native app without any extra fuss. Everything’s as simple as possible, but if you don’t require much from your audio player, there’s no need for buying premium plugins.
Add a single MP3 audio file
- Navigate to Media -> Add New
- Select an MP3 file and upload it
- Open a post/page where you want to insert a player
- Choose the file and embed it into a post/page
If you don’t make any changes, WordPress will automatically add an audio player (like the one you see above this line) which you can see in action from the Visual Editor or on your site if you preview it. But if you open the Text Editor, you will see that the player is actually hidden behind a simple [audio] shortcode.
There are several settings for the Audio Player. To open them, just click on the player in the Visual Editor and click the Edit button (pencil icon). Here, you will be able to replace the audio file quickly, choose to add alternate sources for the file and decide if you want it to be automatically played and played in a loop.
How to use the shortcode
Everything you can do through the Visual Editor, you can do via the shortcode.
- If you have an MP3 file already attached to a particular post/page, just use [audio] shortcode
- If you have URL for your MP3 file, use [audio src="audio-source.mp3"]
- If you want to add fallback file formats, use [audio mp3="source.mp3" ogg="source.ogg" wav="source.wav"]
You can learn more about the Audio Shortcode on WordPress Codex.
Create a playlist
Whether you want to create a playlist and showcase your new songs or allow your user to browse through all of your podcast quickly, you can do that in a few simple steps. Again, you don’t have to install any additional plugins. After you have uploaded all the files to the Media Library, creating a new playlist is simple:
- Open a post/page where you want a playlist
- Click on Add Media button
- From the left side menu, choose the Create Audio Playlist link
- Select audio files for the playlist and click on the Create a new playlist button
- Choose if you want to show Tracklist, Artist Name and Images
- Click on Insert audio playlist button and you will something like this:
That’s it. As we already told you in the introduction, embedding sound files with WordPress is as simple as it gets. If you want more options for your audio files and playlists, you will either have to customize the shortcode manually or install a 3rd party plugin which will extend the player in a specific way. Also, you might be interested in installing a theme entirely dedicated to Music.