Title: Executing Shortcodes in Custom Fields
Last modified: August 20, 2016

---

# Executing Shortcodes in Custom Fields

 *  [Hazel Z.](https://wordpress.org/support/users/cadencehart/)
 * (@cadencehart)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/executing-shortcodes-in-custom-fields/)
 * Hi! I am trying to create and make shortcodes work in Custom Fields. The code
   below works great.
 * I am using More Fields plugin so instead of calling the value of the custom field
   using this code:
 *     ```
       <?php meta('features'); ?>
       ```
   
 * I use this code instead:
 *     ```
       <?php if (get_post_meta($post->ID, 'features', true)) {
         $shortcode = get_post_meta($post->ID, 'features', true);
         echo do_shortcode("$shortcode");
         } else { echo ''; } ?>
       ```
   
 * It works great except that it cannot properly output a **shortcode within a shortcode**.
 * What I need to do is something like this:
 *     ```
       [paragraph][bold]This text is in bold.[/bold] This is the rest of my paragraph.[/paragraph]
       ```
   
 * The code above properly outputs the [paragraph] shortcode but not the [bold] 
   shortcode.
 * Any suggestions? Thank you so much for the help.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Hazel Z.](https://wordpress.org/support/users/cadencehart/)
 * (@cadencehart)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/executing-shortcodes-in-custom-fields/#post-2537250)
 * In case someone has the same issue. Here is the code to use:
 *     ```
       <?php echo apply_filters('the_content', get_post_meta($post->ID, 'features', true)); ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Executing Shortcodes in Custom Fields’ is closed to new replies.

## Tags

 * [custom field](https://wordpress.org/support/topic-tag/custom-field/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [shortcode not working](https://wordpress.org/support/topic-tag/shortcode-not-working/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Hazel Z.](https://wordpress.org/support/users/cadencehart/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/executing-shortcodes-in-custom-fields/#post-2537250)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
