Last updated Apr 4, 2024


Shortcodes can be used within a WYGIWYG to display another field’s value. To learn more about shortcodes, click here.

For security, we recommend disabling the ACF shortcode if you are not using it.


Place the shortcode marker with the desired field within your wysiwyg content. This shortcode runs the same as the the_field() function.

[acf field="field_name" post_id="123"]


This is a story about a boy named [acf field="name"]. He is [acf field="age"] years old.


  • Only works for simple text based values

Disabling the Shortcode

The ACF shortcode allows access to any field on any post type. This means any user who has permission to publish posts on your site can view any ACF data if they know the field name or key. For this reason, we recommend you disable the shortcode if your site is not using it. You can use the following setting to disable it:

add_action( 'acf/init', 'set_acf_settings' );
function set_acf_settings() {
    acf_update_setting( 'enable_shortcode', false );