Description
The URL field is a text input specifically designed for storing web addresses.
Screenshots
Settings
Default Value
The default value shown when creating a new post.Required
Found on the Validation tab, this requires a valid URL be provided as the input and prevents the field from accepting empty values. Defaults to off.Instructions
Shows instructions when submitting data.Placeholder Text
Appears within input when no value exists.
Template usage
Display value
This example demonstrates how to use a URL field named “sales_url” within an anchor tag. We don’t recommend outputting any ACF value without any sort of protection or escaping.
<a href="<?php echo esc_attr( get_field('sales_url') ); ?>"><?php echo esc_attr( get_field('sales_url') ); ?></a>