WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using 'Meta Box Script for WordPress' to create custom meta boxes and everything is working great...except the following: We have a textarea that we want to act, basically as another WP the_content (It's for hidden content that is only shown once a link to show hidden content is clicked). My end-users want to be able to put something like the following in the box:

This is some pretty <a href="#">linked text</a>.

I'm using the following code in my template to show the custom meta box content:

<?php echo get_post_meta(get_the_ID(), 'oc_code', true); ?>

The content it shows is exactly like this (I'm guessing it's not parsing, if that's the correct phrase, the URL): This is some pretty <a href="#">linked text</a>.

What can I do to show a clickable href within the template without adding more custom fields/meta boxes? I was looking at esc_attr, esc_url, etc. but don't know that that is the solution.


share|improve this question
up vote 1 down vote accepted

I finally found the answer to this and am posting it here in case someone else needs the answer. Just put the following in your theme file.


global $post;

$variable_name = get_post_meta($post->ID, 'custom_metaBox', true);

echo html_entity_decode( $variable_name );


Change the variable name and custom_metaBox to your specific values and voila, functioning HTML code.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.