Search for Properties Now!

March 3, 2014

Remove or Hide Post Meta from WordPress Posts

Ever notice that when you look at an article on WordPress — maybe even on your own website — it is very busy?

Sometimes, people just want to read content and having a bunch of random information about the article (what type of coffee the person was drinking when they wrote it, what time it was in China when the article was written, etc.) can be either distracting to a viewer or downright unnecessary.

That extra information is called Post Meta in WordPress, and the following information will inform you as to what post meta specifically is and how you can hide it using CSS, PHP, or — even more easily — our themes.

What is Post Meta in WordPress?

Post Meta is the information in WordPress that displays on a post and tells the reader archive information about the article or post.

On a base level, the user is clued in to what time the post was originally published as well as other information, like the category of the post.

What is post meta wordpress

Displaying the information is good practice for magazines and other news articles because it timestamps information and chronicles the post. Let’s say I really liked an article on CNN’s website (which runs on WordPress). I can see when it was written, and if the article is about technology, for example, I can click on that post meta and get taken to a category archive of recently published technology posts.

This increases readability!

Why Hide or Remove Post Meta?

The problem with Post Meta is that it isn’t for everyone.

While it works on a magazine or news level, the problem is that not everyone is writing articles like that.

When you are writing Evergreen content, or content that never changes, maybe you don’t want the reader to know when the article was originally published. The article, while still relevant today may have been written five years ago and may be seen as irrelevant, even when it isn’t.

Also, too much information on the page, as mentioned above, can become very distracting to a reader.

Hide Post Meta using CSS

You can elements of post meta entirely using CSS coding, which is a bit more of a coder-friendly method.

Once you have created your child theme (which we also make VERY easy with one-click child themes), you can go to the WordPress code editor and tweak the section.post-meta area of our themes to tell it not to display with the:

display: none;

This may not be section.post-meta on other themes not developed by ourselves, but look for something similar.

Hide Post Meta using our WordPress themes

Thankfully, if you are not keen with coding and want a stress-free fix, our themes have been developed with an on-off switch for post meta data.

Access Theme Options on WordPress

With our theme installed, simply visit the WordPress Theme Options section under Appearance > Theme Options and then navigate to the General tab.

Once you have navigated to the proper place, you can go to the section with the sliders and simply click the slider to hide or show the post meta.

Hide or Remove Post Meta in WordPress

Make sure you save the changes before viewing the page to make sure it is being hidden.

It is that simple.

Themes that support the removal of post meta in WordPress:

Edit Post Meta of a Specific Post on WordPress

One way to delete post meta for good is to edit the PHP on specific posts.

Let us say that you had one specific post and you did not want people to access the date or category information on the post.

Using this string, you can delete certain elements of post meta:

<?php delete_post_meta($post_id, $meta_key, $meta_value); ?> 

You would place the id of the individual post, the value of the meta key, which is the element of the post you want to delete, and the value, which is the individual data you want to delete in that element.

Here is a resource for more WordPress information on how to tweak post meta in PHP. Make sure you have a child theme activated before tweaking!!

Print Friendly, PDF & Email