Echo all post meta to the page for debugging

Sometimes you just want to see all the meta attached to a post but don’t want to personally interact with the database. This is a fast and ugly way to do it.

add_action('wp_head', 'output_all_postmeta' );
function output_all_postmeta() {
	$postmetas = get_post_meta(get_the_ID());
	foreach($postmetas as $meta_key=>$meta_value) {
	    echo $meta_key . ' : ' . $meta_value[0] . '<br/>';

We add an action to the wp_head hook that will get all the post meta for that post and echo it at the top of the page.