Display custom fields in the frontend – Post and User Profile Fields


Display post and user custom fields data anywhere on the frontend using a shortcode, including advanced custom fields (ACF) fields.

  • Do you want to display information from a user profile on the frontend?

  • Do you want to display custom fields from a post on the frontend?

  • Have you created metaboxes with Advanced Custom Fields and you want to display those fields?

Use this plugin to display any field for a post or user profile on the frontend.

Basic examples

  • Display email of the current user: [vg_display_data key="user_email" data_source="user_data"]

  • Display first name of the current user: [vg_display_data key="first_name" data_source="user_meta"]

  • Display full name of the current user: [vg_display_data key="first_name,last_name" data_source="user_meta"]

  • Display the title of the current post: [vg_display_data key="post_title" data_source="post_data"]

  • Display the excerpt of the current post: [vg_display_data key="post_excerpt" data_source="post_data"]

  • Display the categories of the post ID = 20: [vg_display_data object_id="20" key="category" data_source="post_terms" template="<b>Categories:</b> {{var}}" joiner=", "]

  • Get featured image url: [vg_display_data key="_thumbnail_id" template="<b>Image url:</b> {{var}}" flag="file_url"]

  • Get featured image as <img> tag.: [vg_display_data key="_thumbnail_id" template="<b>Image:</b> {{var}}" flag="image_tag"]

Advanced examples

  • Display the title for the post ID from the URL containing the parameter ?post_id=ANY_NUMBER: [vg_display_data object_id_type="query_string" object_id="post_id" key="post_title" data_source="post_data"]

  • Get post or user ID from php function: [vg_display_data object_id_type="callable" object_id="function_name" key="post_title" data_source="post_data"]

  • Get email of the current user with phone number = 1234 (meta_key=phone AND meta_value=1234): [vg_display_data object_id_type="find" object_id="phone:1234" key="user_email" data_source="user_data"]


  • object_id = Post ID. Leave empty to use the current post. Possible values: (empty), current, number, query string key if object_id_type=query_string, function name if object_id_type=callable, meta_key:meta_value if object_id_type=find

  • object_id_type = Leave empty if object_id is empty, or current, or is a number. Possible values: query_string , callable , find

  • data_source = What database table to use to find the data. Default = post_meta. Possible values: post_data, post_meta, user_data, user_meta, post_terms.

  • key = Field key. It accepts one or multiple keys separated by commas. For example, to display full name = first_name,last_name. Required.

  • template = HTML fragment to use to display the field, if the field is empty the html is not displayed. Optional.

  • default = Default value to use if the field is empty. Optional.

  • joiner = If the field has multiple values, it will join the values with this string. Default ” ” (one space). Optional.

  • flag = Use only if the field contains a file ID to conver the ID to URL or image tag. Default values: file_url , image_tag. Optional.

  • wp_filter = Whether to run a wp filter on the field value before display. For example, β€œwpautop” to turn line breaks into paragraphs. Optional, only for advanced users.

  • sanitization = Where to allow the display of any html. By default it allows only safe tags, it uses wp_kses_post. Possible values: yes , no. Default: yes. Optional.


Automatic installation

Automatic installation is the easiest option as WordPress handles the file transfers itself and you don’t need to leave your web browser. To do an automatic install log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.

In the search field type β€œShortcode to display post and user data! and click Search Plugins. Once you’ve found our plugin you can install it by simply clicking β€œInstall Now”.

Manual installation

The manual installation method involves downloading our plugin and uploading it to your webserver via your favourite FTP application. The WordPress codex contains instructions on how to do this here.


πŸ‚ πŸ”Ÿ 13, 2023
Thanks for donating this plugin to the WP repository. It is SO helpful, and just what I was looking for - clean, lite weight and easy to use, I added a native custom field because I did not need an entire ACF plugin for just one field, but then needed to figure out how to display it in the sidebar. This was perfect! ACF needs to add something like this to make it easier for users to display fields on front end.
πŸ‚ 9️⃣ 1, 2022
I had a task to pass a custom field value to the setting field of a plugin. That plugin allows shortcode as a field value. I was thinking to write a custom code to get custom field value via shortcode. But what did I think, I searched on google, and got this cool thing.
πŸ‚ πŸ”Ÿ 16, 2021
Works great. We use it to display user's first name at different locations. Very good at giving that personal touch. Please keep this plugin active!!!!!
❄️2️⃣ 24, 2021
This plugin save my project i can see everithing about the users
πŸ‚ 9️⃣ 22, 2020
I've used this plugin on several projects and it is very powerful and useful! Deserves far more downloads.
Read all 8 reviews

Contributors & Developers

“Display custom fields in the frontend – Post and User Profile Fields” is open source software. The following people have contributed to this plugin.



1.2.1 = 2023-04-20
– Only display fields of the current user

– Compatibility with wp 6.0
– Improve compatibility with ACF

– Compatibility with wp 5.8

– Fix. Array values are returned as β€œArray”

– Fixed fatal error

– Added flag term_name to display term ID as friendly name
– Added welcome page after install

– Fix. Allow to use object_id=current for users
– Small tweaks


  • Initial release.