Skip to content
Custom fields for WordPress that are quick to build and quick to load. Get Pro

Text and numbers

URL

A web address, like https://example.com.

When to use it. A web address: a social profile, a download, an external site.

What the editor sees. A single-line box that checks the address.

The URL field on an edit screen
The URL field on an edit screen.
Name in files and code url
ugly_get() gives Text.
Behavior can be required; can share a line with other fields

Settings

Setting What it does Default
Placeholder Gray text shown while the field is empty. (empty)

In your theme

PHP
<?php if ( ugly_get( 'website' ) ) : ?>
	<a href="<?php echo esc_url( ugly_get( 'website' ) ); ?>" rel="noopener">
		<?php echo esc_html( wp_parse_url( ugly_get( 'website' ), PHP_URL_HOST ) ); ?>
	</a>
<?php endif; ?>

Good to know

  • An address that would run code (javascript:) is never kept.
  • To also store the text of the link and whether it opens in a new tab, use Link.