Enable SoundCloud oEmbed on your WordPress site

⏲️ Time: < 1 min

Due to being in a mood involving musician promotion, I’m typing up this quicky tutorial about adding SoundCloud oEmbed support to your site.

Simply add this code snippet it to your theme’s functions.php, a basic quick plugin that you type up as you read this post, or a “Must-Use” plugin.

wp_oembed_add_provider('#https?://(?:api\.)?soundcloud\.com/.*#i', 'http://soundcloud.com/oembed', true);

Once that is added, you can simply paste in SoundCloud based urls into your post and they will automatically embed themselves. You can see an example below, first with the actual url, and then the result.

URL

http://soundcloud.com/haimtime/haim-dont-save-me/s-SGs8F

Result

Resources used


Portrait of Michael

Michael is a seasoned developer who loves helping build stuff for the internet. He brings over a decade of varied experiences working with both front and back end developer stacks.

His primary focus has been WordPress and PHP and all the components that go along with them.

Categories: Web Development

Leave a Reply

Your email address will not be published. Required fields are marked *

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.