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.


1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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