• Advanced Custom Fields

  • PRO
  • Documentation
  • Blog
  • Support
  • Account
  • Purchase
  • Download

Page Link

Documentation Field Types Page Link

Last updated Mar 6, 2023

Description

The Page Link field creates an interactive drop-down to select one or more posts, pages, custom post type items or archive URLs. This field type uses the Select2 library to enable search and AJAX functionality.

Screenshots

A Page Link field that allows you to choose an existing post, page,CPT or archive URL from a list
The Page Link field interface
List of field settings shown when setting up a Page Link field
The Page Link field settings

Changelog

  • Added Allow Archives in version 5.4.0.
  • Added Select2 UI in version 5.0.0.

Settings

  • Filter by Post Type
    Filters the selectable results via one or more post type. When left empty, all post types will be shown. As results are grouped by their post type, the selected post types here may be positioned into a specific order.

  • Filter by Taxonomy
    Filters the selectable results via one or more taxonomy term.

  • Allow Null
    Allows the current selection to be cleared and an empty value to be saved.

  • Allow Archives URLs
    Includes post type archive URLs within the select list of options.

  • Multiple
    Allows you to select more than one choice. When enabled, you may also drag/drop to reorder the selected choices.

Template usage

The Page Link field will return either a single URL or array of URLs. To get more data from a selected post, please use the post object field instead.

Display single value

This example demonstrates how to display a selected page link value.

<a href="<?php the_field('page_link'); ?>">Continue reading</a>

Display multiple values

This example demonstrates how to load and display multiple selected page link values.

<?php 
$urls = get_field('urls');
if( $urls ): ?>
    <h3>Further reading</h3>
    <ul>
        <?php foreach( $urls as $url ): ?>
        <li>
            <a href="<?php echo esc_url( $url ); ?>"><?php echo esc_html( $url ); ?></a>
        </li>
        <?php endforeach; ?>
    </ul>
<?php endif; ?>
Supercharge Your Website With Premium Features Using ACF PRO

Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.

Explore Features View Pricing

PRO Features
ACF Blocks
Options Pages
PRO Fields
Repeater
Flexible Content
Gallery
Clone

Related

  • Field Types: Post Object
  • Content: File
  • Field Types: Link
  • Choice: Radio Button
  • Field Types: User

On this page

    In this category

    • Accordion
    • Button Group
    • Checkbox
    • Clone
    • Color Picker
    • Date Picker
    • Date Time Picker
    • Email
    • File
    • Flexible Content
    • Gallery
    • Google Map
    • Group
    • Icon Picker
    • Image
    • Link
    • Number
    • oEmbed
    • Page Link
    • Password
    • Post Object
    • Radio Button
    • Range
    • Relationship
    • Repeater
    • Select
    • Tab
    • Taxonomy
    • Text
    • Text Area
    • Time Picker
    • True / False
    • URL
    • User
    • Wysiwyg Editor

    Supercharge Your Website With Premium Features Using ACF PRO

    Do more, build bigger, and extend further with features that unlock all the potential of WordPress.

    Explore Features

    Sign up for the latest Advanced Custom Fields news, updates, and developer tutorials

    Build smarter, faster, better with ACF®

    About

    • PRO
    • About Us
    • Blog
    • Account
    • Changelog
    • Status

    Help

    • Docs
    • FAQs
    • Forums
    • Contact
    • Feedback
    • Security

    Community

    • Download ACF
    • GitHub
    • ACF Chat Fridays
    • Twitter

    Products

    • WP Engine Hosting
    • WP Migrate
    • WP Offload Media
    • WP Offload SES

    © 2025 WPEngine, Inc. All rights reserved.

    Privacy Policy | Terms and Conditions

    1WP Engine is a proud member and supporter of the community of WordPress® users. The WordPress® trademarks are the intellectual property of the WordPress Foundation, and the Woo® and WooCommerce® trademarks are the intellectual property of WooCommerce, Inc. Uses of the WordPress®, Woo®, and WooCommerce® names in this website are for identification purposes only and do not imply an endorsement by WordPress Foundation or WooCommerce, Inc. WP Engine is not endorsed or owned by, or affiliated with, the WordPress Foundation or WooCommerce, Inc.

    We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.

    Got it