How to Remove Post Category and Tags in Genesis 2.0 Child Themes

By default Genesis child themes shows post-meta info after the header and footer of a single post. On the header part it shows article publishing  date, authors name and comment link and on the footer part there is file under category and tag links. As most of us use category or tag links as menu items it is not necessary to show them after an article.

The post category and tags can  easily removed from blog posts and pages easily in Genesis 2.0 child themes easily by adding a simple function in function.php file of the child theme. The new code on function.php file will overwrite default Genesis framework output.

For old Genesis child themes the code was as following:

/** Remove the post meta function by wptron **/
remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’);

But as all Genesis 2.0 child themes have HTML5 markup enabled the default hooks changed. Now you have to use the following piece of code to get the same output.

/** Remove the post meta function by wptron **/
remove_action( ‘genesis_entry_footer’, ‘genesis_post_meta’ );

Before

This code will also remove post category and tags from post excerpts. We can also remove anyone from post category and tags. For that purpose we will need a filter instead. To show the categories only use the following code.

After

If you want to show tags instead replace “post_categories” with “post_tags” and add the code in the bottom of function.php file. But before you make any changes on the function.php file please download a copy in your PC.

Meta data on post header can also be edited the same way with following code.

If you want to do the thing in a code free way, there is a free plugin called  Genesis Simple Edits . With Simple Edits you can also edit footer credit links as well as post meta data.




Comments

  1. thanks Arup this is a very good help………

  2. How to remove tags only andd keep the category?

    Thank’s.

    • Try the following code:

      /** Customize the post footer function by wptron */
      add_filter(‘genesis_post_meta’, ‘wpt_info_filter’);
      function wpt_info_filter($entry_footer) {
      if (!is_page()) {
      $entry_footer = ‘[post_categories]‘;
      }
      return $entry_footer;
      }

      • How to remove category only and keep tags?

        • You just need to filter out the tags in post footer.
          Try the following code:

          /** Customize the post footer function by wptron */
          add_filter(‘genesis_post_meta’, ‘wpt_info_filter’);
          function wpt_info_filter($entry_footer) {
          if (!is_page()) {
          $entry_footer = ‘[post_tags]‘;
          }
          return $entry_footer;
          }

  3. Very precise and useful. How about if we remove the author and comment and keep the date on home page?

  4. How to Remove both Tags and Categories

    • Add filter for both or use Genesis simple edit.

      • Add Both like Below. But show Error.

        If add one filter then ok. So Please Tell me what should i do

        /** Customize the post footer function by wptron */
        add_filter(‘genesis_post_meta’, ‘wpt_info_filter’);
        function wpt_info_filter($entry_footer) {
        if (!is_page()) {
        $entry_footer = ‘[post_categories]‘;
        }
        return $entry_footer;
        }

        /** Customize the post footer function by wptron */
        add_filter(‘genesis_post_meta’, ‘wpt_info_filter’);
        function wpt_info_filter($entry_footer) {
        if (!is_page()) {
        $entry_footer = ‘[post_tags]‘;
        }
        return $entry_footer;
        }

  5. Michelle says:

    Hi Arup,

    I added the “post footer function” code in my function.php and it worked, the tags are finally removed. However, when I added the “post header function” code in the same file, my site showed this error:

    “Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.”

    I cannot access wordpress anymore. Have anyone encountered this? Kindly advise. Thank you.

    • Maybe there is some kind of encoding issue while pasting the code. Hope you have got a backup of function.php file. Just replace the function file in theme folder with the old one, everything will become normal again.

      • Michelle says:

        Hi,

        Thanks for your reply. I followed your instructions. My site is up again and everything’s working fine.

  6. how to remove Genesis 2.0 child themes

  7. How do I stop it from showing on homepage?

  8. How to remove only home page?

    • So in the place of if(!is_page()) use !is_home() && !is_front_page() && !is_archive() , to remove the tag/category from homepage as well as from archive pages.

Speak Your Mind

*