sgdghd.com
is not a complete URL on its own, and if used in a link like <a href="https://wordpress.stackexchange.com/questions/358412/sgdghd.com">
, it will be treated as a relative URL. To properly link to a different domain, you need to include http://
or https://
.
To ensure that a value for href
is a valid URL, you should use esc_url()
when outputting it. That way if a user enters an incomplete URL in the settings, it will still be output correctly:
echo '<a href="';
echo esc_url( $settings['url'] );
echo '">';