Allow click tracking for an external host

WordPress only permits tracked redirects to allowed hosts. Add the hostname without a scheme or path, and only add domains you control or trust.

Developer note:

Add custom PHP in a small custom plugin or child theme, and test it on a staging site before production. This example requires ongoing maintenance when extension APIs change.

functions.php

<?php

add_filter( 'allowed_redirect_hosts', 'my_store_allowed_redirect_hosts' );

/**
 * Permit click-tracking redirects to a trusted host.
 *
 * @param string[] $hosts Allowed hosts.
 * @return string[]
 */
function my_store_allowed_redirect_hosts( $hosts ) {
	$hosts[] = 'example.org';

	return array_unique( $hosts );
}
Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.