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

Jak dodawać pliki audio i tworzyć listy odtwarzania w WordPress

Uwaga redakcyjna: Otrzymujemy prowizję z linków partnerskich na WPBeginner. Prowizje nie mają wpływu na opinie i oceny naszych redaktorów. Dowiedz się więcej o Proces redakcyjny.

Chcesz dodać pliki audio do twojej witryny WordPress? Jako system zarządzania treścią, WordPress jest domyślnie zdolny do obsługi plików audio. Wielu początkujących użytkowników nie zdaje sobie jednak z tego sprawy. W tym artykule pokażemy, jak dodawać pliki audio i tworzyć listy odtwarzania w WordPress.

An audio playlist in WordPress

Obsługiwane formaty plików audio w WordPressie

WordPress używa tagu audio HTML5 do osadzania plików audio. Jest on zgodny [może być też „kompatybilny”] z większością nowoczesnych urządzeń i działa szczególnie dobrze na urządzeniach mobilnych. Tag audio HTML5 pomaga w obsłudze formatów plików MP3, OGG i WAV.

MP3 jest najczęściej używanym i szeroko obsługiwanym formatem plików audio i zalecamy korzystanie z niego, gdy tylko jest to możliwe.

Film poradnik

Subscribe to WPBeginner

Jeśli nie podoba Ci się film lub potrzebujesz więcej instrukcji, czytaj dalej.

Dodawanie pojedynczego pliku audio w WordPress

Dodanie pojedynczego pliku audio lub ścieżki muzycznej do dowolnego wpisu lub strony WordPress jest bardzo proste. Wystarczy kliknąć przycisk dodawania multimediów na ekranie edycji wpisu.

Adding an audio file in WordPress post using media uploader

Następnie na twoim ekranie pojawi się wyskakujące okienko ładowania multimediów. Musisz kliknąć przycisk przesyłania pliku, aby wybrać i przesłać twój plik audio. Po przesłaniu pliku należy kliknąć przycisk wstaw do wpisu.

WordPress wstawi twój plik audio do wpisu. Jeśli korzystasz z wizualnego edytora wpisów, będziesz mógł zobaczyć plik osadzany w twoim wpisie. Jeśli korzystasz z edytora tekstu, zobaczysz krótki kod audio.

Single audio file embedded into WordPress visual editor

Możesz kontynuować edycję twojego wpisu lub zapisać go i opublikować. Po opublikowaniu możesz wyświetlić podgląd twojego wpisu, w którym zobaczysz plik audio osadzany w następujący sposób.

A single audio file added in a WordPress post

Innym prostszym sposobem na dodanie pojedynczego pliku audio jest przesłanie go do biblioteki multimediów. Następnie wystarczy skopiować adres URL pliku i wkleić go w edytorze wizualnym.

WordPress automatycznie osadzi adres URL. Jest to podobne do sposobu osadzania filmów w WordPress, gdzie wystarczy wkleić adres URL filmu z YouTube, a WordPress automatycznie go osadzi.

Dodawanie listy odtwarzania audio w WordPress

Podobnie jak galerie obrazków, możesz również dodawać playlisty audio do swoich wpisów w WordPressie za pomocą narzędzia do przesyłania multimediów. Wystarczy kliknąć przycisk dodawania multimediów, aby przesłać twoje pliki audio.

Po przesłaniu twoich plików audio, musisz wybrać pliki, które chcesz dołączyć do listy odtwarzania, a następnie kliknąć odnośnik utwórz nową listę odtwarzania w lewej kolumnie.

Creating audio playlist in WordPress

Możesz teraz przeciągać i upuszczać utwory, aby zmienić ich kolejność na liście odtwarzania. Można również włączyć wyświetlanie nazwy utworu, nazwy wykonawcy i obrazka. Informacje te są osadzane w tagach IDT twojego pliku MP3 i są automatycznie wyświetlane przez WordPress.

Playlist Settings

Po zakończeniu wystarczy kliknąć przycisk wstawienia listy odtwarzania audio. Twoja lista odtwarzania zostanie dodana do twojego wpisu i będziesz mógł ją zobaczyć w edytorze wizualnym. Możesz teraz zapisać swój wpis i wyświetlić podgląd listy odtwarzania.

An audio playlist embedded in a WordPress blog post

Edycja metainformacji plików audio w WordPress

WordPress może automatycznie pobierać meta informacje z twojego pliku MP3. Jeśli jednak twój plik nie zawiera żadnych meta informacji lub chcesz je zmienić, możesz to zrobić w narzędziu do przesyłania multimediów.

Kliknij przycisk Dodaj multimedia, aby uruchomić narzędzie do przesyłania multimediów. Możesz przesłać swój plik audio lub jeśli już go przesłałeś, kliknij go w multimediach.

Po wybraniu pliku audio, po prawej stronie pojawi się kolumna szczegółów załącznika. W tym miejscu można podać tytuł utworu, nazwę wykonawcy, nazwę albumu, podpis i krótki opis utworu. Informacje te będą wyświetlane na listach odtwarzania i na stronach pojedynczych załączników.

audio-meta-info

Jeśli przesłany plik audio ma osadzany obrazek, który ma być użyty jako okładka albumu, to obrazek ten zostanie automatycznie wyodrębniony przez WordPress. Zostanie on zapisany w twojej bibliotece multimediów i będzie używany, gdy ten utwór zostanie dodany do listy odtwarzania.

Jeśli jednak twój plik audio nie ma obrazu okładki, możesz edytować plik w WordPress i przesłać obrazek. Wystarczy przejść do sekcji Multimedia ” Biblioteka, wybrać plik, który chcesz edytować i kliknąć odnośnik edycji znajdujący się pod nim.

Editing an audio file in WordPress

Jeśli zobaczysz bibliotekę multimediów w widoku siatki, kliknięcie pliku audio spowoduje otwarcie wyskakującego okienka. Możesz kliknąć odnośnik Edytuj więcej szczegółów u dołu wyskakującego okienka, aby edytować plik.

Edit more details link

Przejdziesz teraz do strony edycji pliku medialnego, gdzie możesz nie tylko edytować wszystkie meta informacje dla twojego pliku audio, ale możesz także przesłać obrazek wyróżniający. Obrazek ten zostanie użyty po dodaniu pliku audio do listy odtwarzania.

Uploading album cover image by editing media file in WordPress

Dodawanie plików audio i list odtwarzania do widżetów na panelu bocznym

Domyślnie WordPress nie osadza automatycznie adresów URL plików audio. Najpierw musimy włączyć automatyczne osadzanie dla widżetów tekstowych, a następnie musimy włączyć krótki kod. Wystarczy wkleić ten kod w pliku functions.php twojego motywu lub we wtyczce specyficznej dla witryny.

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');

.

Teraz możesz przesłać plik do biblioteki multimediów i skopiować jego adres URL. Dodaj widżet tekstowy do panelu bocznego WordPress i wklej adres URL wewnątrz niego.

WordPress automatycznie osadzi adres URL w odtwarzaczu multimedialnym, aby odtworzyć twój plik audio.

Aby dodać listę odtwarzania, musisz użyć krótkiego kodu z identyfikatorami plików multimedialnych, które chcesz dołączyć do listy odtwarzania.

Najpierw musisz przesłać pliki audio, które chcesz dołączyć do listy odtwarzania, przechodząc na stronę Media ” Utwórz nową.

Teraz musisz edytować każdy plik audio, który chcesz dodać do listy odtwarzania. Wystarczy kliknąć odnośnik edycji znajdujący się pod plikiem w bibliotece multimediów lub kliknąć odnośnik edytuj więcej szczegółów, jeśli przeglądasz bibliotekę multimediów w widoku siatki.

Na stronie Edytuj multimedia pod polem tytułu pojawi się identyfikator pliku multimedialnego.

Getting the media file ID in WordPress

Teraz, gdy masz już identyfikatory plików, które chcesz dodać do listy odtwarzania, możesz użyć krótkiego kodu w następujący sposób:

.

Nie zapomnij zastąpić identyfikatorów twoimi identyfikatorami plików. Możesz użyć tego krótkiego kodu w widżecie tekstowym. Tak to wyglądało na naszej witrynie testowej:

Adding an audio playlist in WordPress sidebar widget

Mamy nadzieję, że ten artykuł pomógł ci dowiedzieć się, jak dodawać pliki audio i tworzyć listy odtwarzania w WordPress. Możesz również zapoznać się z naszym przewodnikiem na temat tego, jak rozpocząć podcast za pomocą WordPressa.

Jeśli podobał Ci się ten artykuł, zasubskrybuj nasz kanał YouTube, aby zobaczyć poradniki dotyczące filmów WordPress. Możesz nas również znaleźć na Twitterze i Facebooku.

Ujawnienie: Nasze treści są wspierane przez czytelników. Oznacza to, że jeśli klikniesz na niektóre z naszych linków, możemy otrzymać prowizję. Zobacz jak WPBeginner jest finansowany, dlaczego to ma znaczenie i jak możesz nas wspierać. Oto nasz proces redakcyjny.

Avatar

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.

Najlepszy zestaw narzędzi WordPress

Uzyskaj BEZPŁATNY dostęp do naszego zestawu narzędzi - zbiór produktów i zasobów związanych z WordPressem, które każdy profesjonalista powinien mieć!

Reader Interactions

70 komentarzyZostaw odpowiedź

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Rachel E says

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

    Thanks for another informative article!

    • WPBeginner Support says

      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.

      Administrator

  3. Afaque says

    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 says

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

      Administrator

  4. Danica says

    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?

  5. Joey says

    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 says

      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.

      Administrator

  6. Tianna says

    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 says

      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

      Administrator

  7. naijahot says

    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 says

    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 says

    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 says

    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 says

    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 says

    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.

      • Lynne says

        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 says

    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 says

    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 says

    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. Christian Wameh says

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

  17. joel says

    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.

  18. Jesse says

    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?

  19. Randy says

    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!!!!

  20. Alison says

    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!

  21. Prosper Ezenwa says

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

  22. John Stephens says

    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?

  23. Steve says

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

  24. francesca says

    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

  25. Jill Bedford says

    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

  26. Melissa says

    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.

  27. Mark Bigland-Pritchard says

    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.

  28. Shirley says

    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.

  29. Kevin Gilbert says

    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.

  30. Juksaa says

    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?

  31. eraxe says

    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

  32. Chris Mueller says

    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 says

      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

  33. Angela Bowman says

    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!

  34. erase says

    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.

  35. emeka nkeze says

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

  36. Emily Barney says

    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 says

      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.

      Administrator

  37. Alpha says

    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?

  38. Peter says

    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 says

      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.

Zostaw odpowiedź

Dziękujemy za pozostawienie komentarza. Pamiętaj, że wszystkie komentarze są moderowane zgodnie z naszymi polityka komentarzy, a Twój adres e-mail NIE zostanie opublikowany. NIE używaj słów kluczowych w polu nazwy. Przeprowadźmy osobistą i konstruktywną rozmowę.