• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2787

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Remove Page & Post Entry Titles Conditionally in Genesis

If you’re looking for a solution to remove post and pages titles, this tutorial is for you.

You can hide titles using CSS code on a per post and page basis using custom classes or the post i.d for a specific page.

But what if you want to remove your titles on all posts or pages?

Using PHP code in a custom function with conditional tags enables you to be more specific.

The code for removing titles from themes running the old Loop hooks is different to the code for themes running HTML 5.

Remove entry titles from all single posts

add_action( 'loop_start', 'remove_titles_all_single_posts' );
function remove_titles_all_single_posts() {
    if ( is_singular('post') ) {
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove page titles from all single pages

add_action( 'get_header', 'remove_titles_all_single_pages' );
function remove_titles_all_single_pages() {
    if ( is_singular('page') ) {
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove page titles from specific pages

add_action( 'get_header', 'remove_titles_from_pages' );
function remove_titles_from_pages() {
    if ( is_page(array('contact', 'about') ) ) {
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove page titles site wide

remove_action('genesis_entry_header', 'genesis_do_post_title');

Remove post titles from specific single posts

add_action( 'get_header', 'remove_titles_single_posts' );
function remove_titles_single_posts() {
    if ( is_single(array('contact', 'about') ) ) {
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove post titles from home page

Assumes you’re using the default WordPress Reading Settings so your front page is your posts page.

add_action( 'get_header', 'remove_titles_home_page' );
function remove_titles_home_page() {
    if ( is_home() ) {
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove Titles From Themes Using Old XHTML Loop Hooks

Here’s a list of code snippets which you can use or modify based on your own needs.

Remove page titles site wide

remove_action('genesis_post_title', 'genesis_do_post_title');

Remove page title for one single page

add_action( 'get_header', 'remove_page_title' );
function remove_page_title() {
    if ( is_page( '3' ) ) {
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove page titles using post i.d’s

add_action('get_header', 'remove_specific_page_titles');
function remove_specific_page_titles() {
    $pages = array( '222','333' );
    if ( is_page($pages) ) {
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove page/post/attachment titles

add_action( 'get_header', 'remove_page_titles' );
function remove_page_titles() {
if ( is_singular() )
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}

Remove page titles from all single posts & pages

add_action( 'get_header', 'remove_titles_pages_posts' );
function remove_titles_pages_posts() {
    if ( is_singular() ){
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove page titles from specific posts

add_action('get_header', 'remove_specific_post_titles');
function remove_specific_post_titles() {
    $pages = array( '5','10' );
    if ( is_single( $pages ) ) {
       remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    }
}

Remove page title on specific page

add_action('get_header', 'remove_page_title_specific_page');
function remove_page_title_specific_page() {
if (is_page('007')) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}

Remove post titles on home page only

add_action('get_header', 'remove_post_titles_home_page');
function remove_post_titles_home_page() {
if (is_home()) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}

Remove titles on single posts but not single pages

add_action('get_header', 'remove_post_titles');
function remove_post_titles() {
if ( !is_page()  || is_single() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}

These working examples should give you a pretty good idea of how to remove post and page titles in Genesis using PHP code. All you need to do is make sure you use the correct conditional tag.

Related Code Snippets

  • Replace Entry Titles On Single Posts With Different Title Text
  • Remove Blog Page Title In Genesis
  • Remove Entry Title Over Essence Pro Hero Image

Reader Interactions

Comments

  1. yor says

    December 8, 2014 at 7:36 pm

    I set up a page with the portfolio template from genesis epik theme. I tried all the snippets with the epik theme, but it won’t work. I just want no title only on home.

    If I comment this line out in the template file, the page title for home is gone:
    add_action( ‘genesis_before_content’, ‘genesis_do_post_title’ );

    But how to achieve this via functions snippet?

    Log in to Reply
    • Brad Dalton says

      December 9, 2014 at 12:49 pm

      You’ll need this for a answer http://wpsites.net/registration/

      Log in to Reply
  2. Chelle says

    October 23, 2014 at 7:38 pm

    Thanks for this! Worked perfectly for what I needed to do 🙂

    Log in to Reply
    • Brad Dalton says

      October 23, 2014 at 7:39 pm

      good stuff

      Log in to Reply
  3. Emily says

    August 20, 2014 at 6:00 pm

    Curious to know how I can conditionally remove post titles / author from *only* a Custom Post Type?

    So many thanks for your post!
    Emily

    Log in to Reply
    • Brad Dalton says

      August 20, 2014 at 6:17 pm

      CSS would be the easiest way where cpt is the name of your custom post type:

      .single-cpt .entry-title {
      	display: none;
      }

      Or you can use the conditional tag

      is_singular('post') or is_post_type_archive()

      Another option is to use a remove_action in a custom post type template file directly like your single-cpt.php or archive-cpt.php

      remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
      Log in to Reply
      • emily says

        August 25, 2014 at 4:28 pm

        perfect, thanks!

        Log in to Reply
  4. Jay says

    August 19, 2014 at 11:11 am

    Perfect tutorial, thank you very much!

    Log in to Reply
    • Brad Dalton says

      August 19, 2014 at 11:35 am

      No worries Jay

      Log in to Reply
  5. Mario says

    July 19, 2014 at 9:50 pm

    This is great.

    How can I remove post meta and post info just from the single posts?

    Log in to Reply
    • Brad Dalton says

      July 19, 2014 at 10:26 pm

      Hello Mario

      Add a conditional tag after the function

      Examples http://wpsites.net/web-design/modify-post-info-genesis/

      Log in to Reply
  6. kristie says

    April 18, 2014 at 2:00 pm

    Hi. Silly question, but where should i put the code for the “Remove page titles from specific pages”?

    Log in to Reply
    • Brad Dalton says

      April 18, 2014 at 2:07 pm

      functions file

      Log in to Reply
  7. Chris says

    March 26, 2014 at 8:05 pm

    Is there a simple way to do this maybe using simple hooks? I am trying to remove the HOME from this static home page.

    Log in to Reply
    • Brad Dalton says

      March 26, 2014 at 8:14 pm

      You can simple remove it from the page title in the Edit screen

      Or you could use CSS code:

      .home .entry-title {
      display: none;
      }

      Or you could create a front-page.php template file.

      Log in to Reply
      • Chris says

        March 26, 2014 at 8:21 pm

        The problem with removing it in the Edit screen is that it removes it from the menu.

        I was told I shouldn’t edit CSS code for genesis?

        I don’t know how to create those php files.

        Log in to Reply
        • Brad Dalton says

          March 26, 2014 at 8:37 pm

          You can still add it to the menu as a custom link.

          Or you add the CSS code in your child themes style.css file, Not the Genesis style sheet.

          Log in to Reply
          • Chris says

            March 26, 2014 at 8:55 pm

            Removing it in the Edit Page and then adding it as a Custom Link to the menu seemed to do the trick. Thank you!

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags