
Getting Started
| Author: | PinoyITSolution (profile at wordpress.org) |
| WordPress version required: | 6.3 |
| WordPress version tested: | 7.1 |
| Plugin version: | 3.4.0 |
| Added to WordPress repository: | 11-10-2018 |
| Last updated: | 13-04-2021
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
| Rating, %: | 0 |
| Rated by: | 0 |
| Plugin URI: | https://www.pinoyitsolution.com |
| Total downloads: | 3 394 |
| Active installs: | 10+ |

Click to start download
|
YoutubeSubscriberCount Plugin/Widget for WordPress
A customizable widget that allows admins to add a Youtube Button to their WordPress site. Enables admin to indicate Channel, Layout and Count visibility.
Getting Started
Download the plugin and extract it inside the wp-content/plugins folder of your WordPress site.
Prerequisites
Indicate a valid Channel ID on Widget options.
Invalid Channel ID will cause the plugin to display Error. Get ID from here(https://www.youtube.com/account_advanced)
Installing
Here’s the step by step instructions on how to install the plugin.
First, download a copy of the plugin from WordPress plugin directory, Bitbucket or our official website (https://pinoyitsolution.com/portfolio/wordpress-youtube-subscriber-count-plugin/).
Second, extract files on wp-content/plugins folder.
Third, go to your WordPress Admin Plugins Page, find and activate “YT Sub Counter”
Fourth, go to WordPress Admin Widgets Page, Look for Youtube Subscribers add to a widget area as desired.
Fifth, edit widget and change widget settings and save.
Authors
License
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Screenshots

The subscribe button with its live subscriber count on the front end.

Site-wide defaults under Settings > YT Sub Counter, with a preview of the button.

The "YouTube Subscribe" block in the editor, previewing the button, with every option set to "Use site default".

The block in a Row alongside the Social Icons block, as one more social button.
FAQ
Nothing is displayed
Check that a Channel ID is set under Settings > YT Sub Counter, or directly on the block, shortcode or widget. The button is not rendered when no channel is configured.
The button shows an error
Make sure you’ve entered a valid YouTube Channel ID, not a custom URL or a handle beginning with @. Your Channel ID is the string starting with “UC” shown at https://www.youtube.com/account_advanced
I can’t find Appearance > Widgets
Block themes, including the recent default WordPress themes, do not have widget areas, so the Widgets screen does not exist for them. Use the “YouTube Subscribe” block instead. In the Site Editor you can add it to any template, including headers and footers, which is where a sidebar widget would once have gone.
How do I show it next to my other social icons?
Add a Row block, put core’s Social Icons block in it, then add the “YouTube Subscribe” block beside them. The Row’s alignment controls will line them up. The subscribe button is rendered by YouTube, so it keeps YouTube’s own styling rather than inheriting your social icon colours.
Is the widget going away?
Existing widgets keep working and there is no plan to remove the widget. It is no longer the recommended way to add the button, because WordPress itself has moved on from widget areas.
Can I show more than one channel?
Yes. Set the channel on the shortcode itself, for example [ytsub channel="UCxxxxxxxxxxxxxxxxxxxxxx"]. Any shortcode attribute overrides the site-wide setting.
What shortcode attributes are available?
channel, layout (default or full), theme (default or dark) and count (default or hidden). Anything you omit falls back to the setting saved under Settings > YT Sub Counter.
ChangeLog
3.4.0
- Improve: the settings screen is laid out in cards, with the channel and appearance options separated and instructions for the block, shortcode and widget alongside them.
- New: a preview of the subscribe button on the settings screen that updates as you change layout, theme and count.
- New: the block shows that same preview on the canvas, instead of a grey placeholder box, so it looks like what visitors will see.
- New: the block uses the YouTube mark as its icon in the inserter and list view.
- New: copy button for the [ytsub] shortcode, and help tabs on the settings screen.
- Improve: a warning on the settings screen, and in the block, when no channel ID is set and nothing will be displayed.
- Assets: plugin icon and header image for the plugin directory.
3.3.0
- New: settings screen under Settings > YT Sub Counter for site-wide defaults.
- New: “YouTube Subscribe” block, for posts, pages and the Site Editor. This replaces the widget on block themes, which have no widget areas, and can sit in a Row alongside the Social Icons block.
- New: [ytsub] shortcode, for templates and other places blocks are not available.
- New: Settings link on the plugins screen.
- Improve: widget options left empty now fall back to the site-wide settings.
- Fix: option values (default, full, dark, hidden) were passed through translation functions, which could break the button on non-English sites.
- Harden: channel IDs and select values are validated against an allow list on save and on output.
- Privacy: Google’s platform.js is now loaded only on pages that actually display a subscribe button, instead of on every front-end page.
- Remove: an empty stylesheet and a placeholder script that were enqueued on every front-end page.
- Docs: describe when platform.js is loaded, and correct the screenshot list.
- Update: requires WordPress 6.3, for the block’s apiVersion 3 and iframe editor compatibility.
- Update: tested up to WordPress 7.1.
3.1.1
- Fix: “Tested up to” now correctly lists only the major WordPress version.
- Docs: disclose the external YouTube/Google platform.js service in this readme.
- I18n: text domain corrected to match the plugin slug (show-youtube-subscribers-count).
- Security: escape the filtered widget title with esc_html() before output.
- Fix: renamed the generic “google” script handle to the prefixed “ytsub-youtube-platform”.
3.1.0
- Security: escape widget output (channel, layout, theme, count) with esc_attr() to prevent stored XSS via widget settings.
- Fix: enqueue js/main.js as a script instead of a stylesheet.
- Fix: correct asset URL resolution so css/js load from the plugin root.
- Update: tested up to WordPress 7.0.2.
2.0.0
- Add theme options dark and default.
- Correct error when using a non custom YouTube URL.
1.0.0