---
title: "URL Field in WordPress"
url: https://nexterwp.com/docs/wordpress-url-field/
date: 2026-11-12
modified: 2026-11-12
lang: en
author: "Aditya Sharma"
description: "A URL field stores a single web address and validates it as it is typed. Use it when you need only the address — if you also want link text..."
image: https://nexterwp.com/wp-content/uploads/2026/09/wordpress-url-field-1024x519.jpg
word_count: 381
---

# URL Field in WordPress

## Key Takeaways

- Nexter Extension 4.9.0 adds a URL field that stores one web address only, with no title or target, and validates the format as it is typed.
- Nexter bb Content Fields uses the Group Fields tab to add a URL field, such as Field Label "Virtual tour link" and Field Type "URL".
- URL field output passes through esc_url(), and missing https:// makes the browser treat the link as relative to the current site.

A **URL field** stores a single web address and validates it as it is typed. Use it when you need only the address — if you also want link text and a target, use a Link field instead.

## What It Does

The field stores a URL string. It is deliberately narrower than a Link field: one value, no title, no target.

## Before You Start

- Nexter Extension is installed and active.- Content Fields is enabled under **Nexter → Content Fields**.- You have a field group, or are about to create one.

## Add a URL Field

- Go to **Nexter → Content Fields** and open the **Group Fields** tab.

- Open a field group, or create a new one.

- Click **Add Field**.

![A field group open with the Add Field button](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-h-shared-add-field.webp)

- Set **Field Label** to *Virtual tour link*. The **Field Name** fills in automatically and is what you use in code.

- Set **Field Type** to **URL**.

![The Field Type dropdown listing the available field types](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-h-shared-field-type.webp)

- Click **Update**.

![The URL field as it appears on the post editing screen](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-h-tour-editor.webp)

![The URL field settings in the Content Fields builder](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-h-tour-settings.webp)

## Field Settings

Every field is configured across four tabs. These are the settings this field type offers, read from the field group builder in Nexter Extension 4.9.0.

### General

| Setting | Options | What it does |
| ------- | ------- | ------------ |
| **Default Value** | | *No help text in the UI.* |

### Validation

| Setting | Options | What it does |
| ------- | ------- | ------------ |
| **Required** | | *No help text in the UI.* |

### Presentation

| Setting | Options | What it does |
| ------- | ------- | ------------ |
| **Instructions** | | *No help text in the UI.* |
| **Placeholder Text** | | *No help text in the UI.* |
| **Prepend** | | *No help text in the UI.* |
| **Append** | | *No help text in the UI.* |
| **Wrapper Attributes** | | *No help text in the UI.* |

### Conditional Logic

| Setting | Options | What it does |
| ------- | ------- | ------------ |
| **Conditional Logic** | | *No help text in the UI.* |

## When to Use It

- A virtual tour or external demo link.- A source or reference URL.- A social profile on a team member.

## Display the Value

Always pass a URL through `esc_url()`:

`<?php
$url = nxt_field_value( 'tour' );
if ( $url ) {
printf(
'<a href="%s" target="_blank" rel="noreferrer noopener">View the tour</a>',
esc_url( $url )
);
}`

## Limitations

- Stores the address only. For link text and target as well, use a Link field.- Validation checks the format, not that the page exists.

## Troubleshooting

### The link goes to a page on my own site

The stored value is missing its scheme, so the browser treats it as relative. Save the full address including `https://`.

### I need the link to show custom text

A URL field stores only the address. Either hard-code the text as above, or switch to a Link field.

## Related Docs

- [Create your first field group](https://nexterwp.com/docs/create-a-field-group-wordpress/)- [Display a field value on the front end](https://nexterwp.com/docs/display-custom-field-value-wordpress/)

## Frequently Asked Questions

**Q: How is a URL field different from a Link field in WordPress?**
A: A URL field stores only one web address, so it is narrower than a Link field. That matters when you just need the destination and do not need link text or a target. Nexter Extension uses this for simple address storage, while a Link field is the better fit when the label and target behavior also matter.

**Q: Why does my WordPress URL field link open on my own site instead of the external page?**
A: That usually happens when the saved value is missing its scheme, so the browser treats it as a relative URL. The fix is to store the full address, including https://. In Nexter Extension, the field validates format, but it does not correct an incomplete path into an absolute link.

**Q: When should I use a URL field instead of another custom field type?**
A: Use a URL field for cases like a virtual tour link, an external demo link, a source or reference URL, or a social profile on a team member. It fits when the only thing you need to store is the address itself. If you need custom text or a target attribute too, that points to a Link field instead.

**Q: How do I display a WordPress URL field safely on the front end?**
A: The safe pattern is to pass the stored value through esc_url() before printing it in an anchor tag. The example in Nexter Extension uses nxt_field_value( 'tour' ) and outputs a link with target="_blank" and rel="noreferrer noopener". That protects the output and keeps the generated link clean for front-end use.

**Q: What are the limitations of a WordPress URL field?**
A: A URL field stores only the address, not link text or target settings. It also validates format rather than checking whether the page actually exists. That means it is good for clean data entry, but it will not catch broken destinations or give you built-in custom anchor text.

**Q: What do I need before adding a URL field in Nexter?**
A: Nexter Extension has to be installed and active, and Content Fields must be enabled under Nexter → Content Fields. You also need an existing field group or one you are about to create. In practice, that setup matters because the URL field lives inside the group builder rather than as a standalone setting.
