If you need to remove date, authors and tags, categories buttons below the post titles, here are two useful code snippet
Where to copy/paste this code?
This php code requires you to use a Child Theme. Everything you need to know about creating a child theme with Customizr here.
1) First method (removes all metas)
Copy/paste into your customizr child theme functions.php
//we hook the code on the __before_body hook, which is executed before the rendering. add_action ('__before_body' , 'remove_post_metas'); function remove_post_metas() { //we remove the original action hooked on '__post_metas'. tc_post_metas action is a method of the TC_post_metas class //We can access the instance of this class with a static property of this class that is a self instance. remove_action ( '__post_metas' , array( TC_post_metas::$instance , 'tc_post_metas' )); }
2) Alternative Method (removes only categories and tags)
Copy/paste into your customizr child theme functions.php
//Remove meta-tag buttons add_filter('tc_category_list', 'rdc_category_list'); function rdc_category_list($output) { return preg_replace('"btn btn-mini"', '""', $output); } add_filter('tc_tag_list', 'rdc_tag_list'); function rdc_tag_list($output) { return preg_replace('"btn btn-mini btn-tag"', '""', $output); }
21 thoughts on “Remove categories and tags buttons in the post metas block”
Hello
I want to remove tags from homepage only. I want them only on Posts and not on index page.My website is http://hdmotionmovies.com/
Hi,
You can use a conditional like is_home() and check for homepage before removing tags.
Hope this helps.
Hi there.. I wanted to use a child theme for my customizr pro, but all my information gets lost once I activate it. The reason for why i wanted to do this was to eliminate the archives categories and tags on the beginning of each post and page, so that didn’t work and i went ahead and copy pasted your code:
//Remove meta-tag buttons
add_filter(‘tc_category_list’, ‘rdc_category_list’);
function rdc_category_list($output) {
return preg_replace(‘”btn btn-mini”‘, ‘””‘, $output);
}
add_filter(‘tc_tag_list’, ‘rdc_tag_list’);
function rdc_tag_list($output) {
return preg_replace(‘”btn btn-mini btn-tag”‘, ‘””‘, $output);
}
To the Functions PHP of my Customizr Pro, but still you could see the category archives and all the information I didn’t want to see so I eliminated that. And now when i want to see my web page its in BLANK! What should i do?!
Hope you can help me!
Thankyou
Hi Jessica,
There’s an option to disable the post metas (like categories or tags) in the theme customizer. Navigate to
Appearance > Customize > Content > Post metas
and you’ll be able to select which metas you want to display.Did this help ?
Hi Nicolas,
I tried this method and after I save and go back to view my website the meta descriptions are still there.
I unchecked “Display Post Metas” but they still show after I save.
Any Suggestions?
Thank You
Hi there!
My problem is that I want to rid of hyperlinks on date numbers in my blog page and individual posts but not the numbers themselves. I use a Child Theme and would like to have some code to insert in the functions.php for example. Thanks!
I would just like to get rid of any mention of tags, categories and author on my posts. So where it says, “This entry was posted in Uncategorized on November 12, 2014.” I just want the date and nothing else. How do I achieve this?
Hi Sharon, this will be available as an option in the next release of the theme. (in the next days)
Thanks for your feedback.
Hi,
looking at this page, I can see, under the post title a lot of tags or categories grouped by some labels: can you please help me in understanding how can i have the same results?
Thank’s a lot
Hi biagio, this has been done by using the hook of the post meta : ‘__after_content_title’.
You can add whatever action you want to this hook.
Hope this helps!
Nicolas,
thank you for your reply: unfortunately I’m new of your beautiful theme and of wordpress in general. What I would realize is exactly what you has on this blog: some tags groups (or category groups), organized with label for each groups and differenziate with colors.
It’s possible to give more details on thar (by ex. some example code or references)?
Thank’s for your patience.
I am having the same problem. Added the code snippet, and the buttons disappeared, but the text with hyperlinks are still there.
I wish to remove categories and tag, but want the date and author to show.
Thank you for your help!
– Margrethe
I’m not sure if I’m doing this right. My goal is to display the author name and date posted, without the categories or tags showing up. I added the code snippet from #2 (Alternate method) into my child theme functions, however it is still showing the category and tags :/
Here’s a link to one of my categories: http://www.thenakedlifecoach.com/category/media
Please advise how I can resolve this issue.
Thank you for your time!
Nadine
PS: adding the #1 Method (to remove all metas) in the function.php file worked great, however I DO want to still display the post date at the very least, so is there a way to remove all the info except that?
Hi Nadine – I see from your link that you figured out how to display just the author and date with your posts. Can you share your code snippet that accomplished this? Thanks!
Hey! Thanks for the post!
I must admit I’m a true beginner here. So what I assumed the code would do is remove the thumbnail on left of the category name. AS in here: http://www.adventuresoulutions.com/?page_id=2
Somehow it’s still there.. Do you have any idea what else I could do?
Thanks
Hi Elina,
I don’t really get your point?
I’d suggest the Forum would be a better place to get a solution for this, and include a link to your Site.
hallo, i try this but i still see categories and tags in the post metas block, not the buttons but the name of the category, tags, autor and date…
how can i clean it
to see only the name of the post and nothing more?
Thanks!!!
Try to use this snippet, with only the remove_action line of code
http://www.presscustomizr.com/snippet/moving-single-post-metas-to-the-bottom-of-the-post/
Thanks for adding this so quickly! (see http://wordpress.org/support/topic/how-to-remove-btn-mini-category-tag-etc?replies=6). Great support here and a great theme! Will dive deeper into it to explore all functions and customizing functiions…
You are welcome, that’s the purpose of those snippets! and thanks to @Dave for this!
Bests