Easy to add audio files on your WordPress website without any coding knowledge! This article will guide you how to use WordPress built-in features and plug-ins to easily add audio content and improve user experience.
Key points:
- WordPress supports audio files by default, adding audio is as simple as adding pictures.
- WordPress comes with audio player that supports MP3, M4A, OGG and WAV formats, and can create playlists.
- You can use external audio hosting platforms such as SoundCloud to embed audio to reduce the burden on the server.
- If you need more features or customization options, you can use plug-ins such as Compact WP Audio Player, MP3-jPlayer, and SoundCloud is Gold.
This article is created in collaboration with SiteGround. Thanks to our partners for supporting us for making SitePoint possible.
Want to share audio files on your website? Facebook does not allow sharing audio directly unless you take tedious methods such as sharing on Dropbox or converting to video. But if you have your own WordPress website, this will be very simple.
Adding audio is not difficult. We are not referring to adding cheesy background music to an outdated website full of GIF animations. Although it is not a wise move to add music casually, it does have a reasonable use to include audio on the website:
- Musicians share music samples.
- Bloggers share podcasts.
- Schools, churches and event websites provide audio for seminars, sermons or keynotes.
- Teachers, trainers and educators add audio examples to online courses.
- Bloggers add interviews and other extra content.
You may not know that WordPress supports audio file processing by default. If you know how to insert images into articles, inserting audio is just as easy.
Before HTML5, there was no standard method for playing audio on web pages. Flash was used widely, but the effect was not ideal. WordPress uses HTML5 to embed audio and is compatible with most browsers and devices, including mobile devices.
There are other ways to add audio to your website, including embedded players and WordPress plugins for third parties, including audio library sites. These methods provide additional functionality and allow the use of audio from the library website.
Of course, only use audio files that you have the right to use, including audio you created yourself, licensed audio and royalty-free audio. The sample audio used in this article comes from YouTube's free music library.
1. Use WordPress Audio Player
The easiest way to add audio to a website is to use the audio player that comes with WordPress. Unless you have special needs, there is no need to look for other ways.
You can add MP3, M4A, OGG, or WAV files to your WordPress media library. You can then insert it into the article and add an optional title.
The steps are as follows:
- Click on the "Add Media" button.
- Drag and drop the audio file into the library, or click "Upload File" and select the file to add the audio content to the media library.
- On the right side of the screen, fill in the relevant metadata of the audio file, including title, artist, album, title, and description.
- Make sure the Embed Media Player option is selected so that readers can play audio files from your article.
- Click "Insert to Article".
The following is a screenshot of the media player after adding some audio files. You can fill in the relevant metadata of the file in the panel on the right.
The following is a text view of the article after adding the image (see the second paragraph). This screenshot also demonstrates several other ways to manually add audio player code.
The following is the look of the article after preview or posting. A mini player that displays audio files. Note that the player looks the same for all three methods.
Example:
Click the audio file below to listen:
http://ipnx.cn/link/18091ec91aec4f3a9a5f2aa73c0a18ca
You do not need to store audio files in WordPress media player. Store them on other servers can reduce the load on hosting your website, saving storage space, system resources, and bandwidth. In this case, use the same audio shortcode, but use the correct URL of the audio file.
You can loop or automatically play audio files by adding some options to your code (see the audio shortcode page on WordPress.org). To change the color of the media player, you need to use the following custom CSS:
<code>.music-player .wp-playlist-light, .music-player .wp-playlist-light .wp-playlist-playing { background: #999; border-color: #999; }</code>
Or, if you need extra features or customize the look of the media player, check out the plugin below.
(The following content is similar to the original text, but the sentence adjustments and paragraph divisions have been made to achieve pseudo-original effects, and pictures and links have been retained)
2. Create WordPress audio playlist
Do you have multiple audio files to share? WordPress also has built-in playlist support. Here is the way to get started:
- In the media library, click "Create Audio Playlist".
- Select the audio file to include in the playlist.
- Add the relevant metadata for the playlist and click "Create a new playlist".
- Select the desired option (for displaying track list, artist name, and picture) and click "Insert Audio Playlist".
The following is the screen you see after clicking on "Create Audio Playlist" in the media library. This option is only available if there are audio files in the library.
The following are the options you can choose for the playlist.
The following is a text view of the article after adding the playlist shortcode.
The following is the appearance after release.
Example:
This is an embedded playlist you can play:
- Digital Watch Alarm Long
- Medium Bell Ringing Near
- Crowd Yelling Series
- Walking on Hollow Metal
- Walk on Grass Series
3. Embed audio using SoundCloud player
SoundCloud is a popular service dedicated to sharing music online, similar to the audio version of YouTube. You can use SoundCloud to host audio from your embedded website, or share content already on SoundCloud.
SoundCloud simplifies the process of embedding content on its website:
- Any SoundCloud audio file that allows embedded will have a share button below it. Click on it.
- Click "Embed" and select a large square player or a smaller rectangular player. Select any option you need.
- Copy the code and paste it into your post.
The following is the screen displayed after clicking the "Share" button on SoundCloud. Click Embed at the top and select the option you prefer. Don't check the "WordPress Code" box unless your website is hosted on WordPress.com.
The following is what it looks like after pasting the code into the article.
The following is the appearance of the SoundCloud player after your article goes live.
You can also use the plugin SoundCloud is Gold, which we will introduce below. Other audio library websites, including Audiomack, offer similar embedded players.
4. Use WordPress audio plugin
If you need more powerful features or more flexible configurations than WordPress audio players, you can use the plugin. Here are some highly rated options that may contain what you need. (The plugin list is consistent with the original text, repeated description is omitted)
Adding audio on your website is just one of many interactions you can do with WordPress. If you are looking for feature-rich hosting WordPress hosting, check out our partner SiteGround, which also offers free website migration services. Do you include audio on your website? Which method do you use?
(The FAQ part is similar to the original text, but the sentence adjustment and paragraph division are made to achieve pseudo-original effect)
The above is the detailed content of 4 Simple Ways to Add Audio to Your WordPress Site. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The main reasons why WordPress causes the surge in server CPU usage include plug-in problems, inefficient database query, poor quality of theme code, or surge in traffic. 1. First, confirm whether it is a high load caused by WordPress through top, htop or control panel tools; 2. Enter troubleshooting mode to gradually enable plug-ins to troubleshoot performance bottlenecks, use QueryMonitor to analyze the plug-in execution and delete or replace inefficient plug-ins; 3. Install cache plug-ins, clean up redundant data, analyze slow query logs to optimize the database; 4. Check whether the topic has problems such as overloading content, complex queries, or lack of caching mechanisms. It is recommended to use standard topic tests to compare and optimize the code logic. Follow the above steps to check and solve the location and solve the problem one by one.

Methods to optimize WordPress sites that do not rely on plug-ins include: 1. Use lightweight themes, such as Astra or GeneratePress, to avoid pile-up themes; 2. Manually compress and merge CSS and JS files to reduce HTTP requests; 3. Optimize images before uploading, use WebP format and control file size; 4. Configure.htaccess to enable browser cache, and connect to CDN to improve static resource loading speed; 5. Limit article revisions and regularly clean database redundant data.

Miniving JavaScript files can improve WordPress website loading speed by removing blanks, comments, and useless code. 1. Use cache plug-ins that support merge compression, such as W3TotalCache, enable and select compression mode in the "Minify" option; 2. Use a dedicated compression plug-in such as FastVelocityMinify to provide more granular control; 3. Manually compress JS files and upload them through FTP, suitable for users familiar with development tools. Note that some themes or plug-in scripts may conflict with the compression function, and you need to thoroughly test the website functions after activation.

TransientsAPI is a built-in tool in WordPress for temporarily storing automatic expiration data. Its core functions are set_transient, get_transient and delete_transient. Compared with OptionsAPI, transients supports setting time of survival (TTL), which is suitable for scenarios such as cache API request results and complex computing data. When using it, you need to pay attention to the uniqueness of key naming and namespace, cache "lazy deletion" mechanism, and the issue that may not last in the object cache environment. Typical application scenarios include reducing external request frequency, controlling code execution rhythm, and improving page loading performance.

Object cache assists persistent storage, suitable for high access and low updates, tolerating short-term lost data. 1. Data suitable for "persistence" in cache includes user configuration, popular product information, etc., which can be restored from the database but can be accelerated by using cache. 2. Select a cache backend that supports persistence such as Redis, enable RDB or AOF mode, and configure a reasonable expiration policy, but it cannot replace the main database. 3. Set long TTL or never expired keys, adopt clear key name structure such as user:1001:profile, and update the cache synchronously when modifying data. 4. It can combine local and distributed caches to store small data locally and big data Redis to store big data and use it for recovery after restart, while paying attention to consistency and resource usage issues.

When developing Gutenberg blocks, the correct method of enqueue assets includes: 1. Use register_block_type to specify the paths of editor_script, editor_style and style; 2. Register resources through wp_register_script and wp_register_style in functions.php or plug-in, and set the correct dependencies and versions; 3. Configure the build tool to output the appropriate module format and ensure that the path is consistent; 4. Control the loading logic of the front-end style through add_theme_support or enqueue_block_assets to ensure that the loading logic of the front-end style is ensured.

PluginCheck is a tool that helps WordPress users quickly check plug-in compatibility and performance. It is mainly used to identify whether the currently installed plug-in has problems such as incompatible with the latest version of WordPress, security vulnerabilities, etc. 1. How to start the check? After installation and activation, click the "RunaScan" button in the background to automatically scan all plug-ins; 2. The report contains the plug-in name, detection type, problem description and solution suggestions, which facilitates priority handling of serious problems; 3. It is recommended to run inspections before updating WordPress, when website abnormalities are abnormal, or regularly run to discover hidden dangers in advance and avoid major problems in the future.

The most effective way to prevent comment spam is to automatically identify and intercept it through programmatic means. 1. Use verification code mechanisms (such as Googler CAPTCHA or hCaptcha) to effectively distinguish between humans and robots, especially suitable for public websites; 2. Set hidden fields (Honeypot technology), and use robots to automatically fill in features to identify spam comments without affecting user experience; 3. Check the blacklist of comment content keywords, filter spam information through sensitive word matching, and pay attention to avoid misjudgment; 4. Judge the frequency and source IP of comments, limit the number of submissions per unit time and establish a blacklist; 5. Use third-party anti-spam services (such as Akismet, Cloudflare) to improve identification accuracy. Can be based on the website
