Automatically Add Subscribe Link to Each YouTube Embed Video in WordPress

Add Subscribe Link to Each YouTube Embed Video in WordPress

Many of you already know about my tech blog Techlomedia and Techlomedia Gadgets. For these, I also make videos of gadgets and embed in articles. Many times, I also embed other people’s videos in the articles. Recently, I saw that few big websites are using a kind of plugin to add Subscribe button just below the video and it really helps in converting viewers into Subscribers.

I thought to do the same and started searching for plugins. I found one but it didn’t work. So, I thought to code it by myself and it was a simple less than 5 minutes of effort to achieve the desired result.

See the featured image to know how it looks on my website.

If you also want to add something similar, I am adding the code snippet below.

<script type="text/javascript"> 
$(".video-container").after("<div class='ytS' style='background: #333; color: #fff; text-align: center; padding: 10px;'><div class='yts-inner'>Subscribe Our channel <div class='g-ytsubscribe' data-channel='deepanker70' data-layout='default' data-count='default'></div></div></div>");

Here, you only need to replace the data-channel with the username of your channel. You can also make changes in the style thing to customize it.

Even if the code is written in javascript, I have not tested it on any other platform except WordPress. It should work on other platforms as well. You only need to check the video container selector. video-container is the primary selector I used. If your platform is using something else, change it accordingly.

I have not yet made any plugin for this due to lack of time and I am not sure how many of you are really interested in that. If you want me to write a WordPress plugin for the same, you can comment below. I will surely consider of writing a plugin for this.

Tags: |

Deepanker Verma is the founder of Techlomedia. He is a tech blogger, developer and gadget freak.

Similar Articles


Leave a comment

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.

2020 UseThisTip | Part of Techlomedia Internet Pvt Ltd Developed By Deepanker