How to Get YouTube Channel Subscriber Count without Using API

YouTube provides these subscribe buttons which include the number of your channel subscribers which can be extracted using a simple regular expression.

Extract the Subscribe Count in PHP


// Change channelid value to match your YouTube channel ID
$url = '';

// Fetch the Subscribe button HTML
$button_html = file_get_contents( $url );

// Extract the subscriber count
$found_subscribers = preg_match( '/="0">(\d+)</i', $button_html, $matches );

if ( $found_subscribers && isset( $matches[1] ) ) {
    echo intval( $matches[1] );

The Channel ID can be found on your YouTube profile page.


Here is the number of subscribers of my YouTube channel.

Use Contact Form 7 to collect business leads and enquiries? I created Storage for Contact Form 7 plugin which stores them safely in WordPress database.

Get it now for only $19 →

Leave a Reply