Get the tld of a WordPress site

$hostname = wp_parse_url( home_url(), PHP_URL_HOST );
$tld = end( explode( '.', $hostname ) );

Leave a Reply

Your email address will not be published.