Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Tyrone Sunde
PLUS
Tyrone Sunde
Courses Plus Student 6,379 Points

Hide Meta Section in Wordpress

I'm trying to figure out how to hide the meta section in Wordpress but I can't figure out how to do it. Do I have to use code to do it?

6 Answers

Wally Soukoroff
Wally Soukoroff
6,649 Points

Hi Tyrone,

There's no code involved in this and you don't need to edit any template files.

In the WordPress admin when you're logged in, hover the Appearance link in the menu on the left and then click the Widgets link.

You will open up the widgets page and then you'll see the sidebar blocks (toggles).

Inside one of these you'll have a wordpress meta widget.

Click it and drag it out to the left and bottom into the unused widgets or click on it to open it up and delete/remove it.

Then go to the frontend of your website and refresh the page.

The default meta widget block should now be gone.

Cheers!!!

Traci Larson
Traci Larson
4,264 Points

Tyrone, are you trying to hide it on the front end of the site or in the backend?

If you want to remove it from your template, you're looking for something like this code:

<?php $meta_values = get_post_meta( $post_id, $key, $single ); ?>

If you find that in your single.php (or other theme file) and comment it out, the meta information will not be displayed.

Tyrone Sunde
PLUS
Tyrone Sunde
Courses Plus Student 6,379 Points

I think that I want to hide it on the front end. I don't want it to be visible on my page.

Traci Larson
Traci Larson
4,264 Points

Yes, try editing your theme's template files to remove the get_post_meta() function.

Tyrone Sunde
PLUS
Tyrone Sunde
Courses Plus Student 6,379 Points

I just commented out the pertinent area of html. Below are the steps.

  1. Go to "Appearance"
  2. Click "Editor"
  3. Click "Sidebar"
  4. Find the section where the list items start that are associated with the meta section and put an HTML style comment around that section.
Traci Larson
Traci Larson
4,264 Points

Ah yes, I misunderstood what "Meta" info that Tyrone was talking about. Wally's on it.