• Building a website?

    We build professional, user-friendly and engaging websites for businesses and individuals who require an impressive online presence.

    We're ready to discuss your project today —

    Contact Creative World

  • Keep in touch

    Sign up for our 'not so monthly' newsletter - updates, offers, tips and more.





  • Archives

  • Related Pages

  • Related Posts

How to remove the “Page Title” from your WordPress Homepage

A common question people ask when designing a WordPress theme is “How to remove/hide the “Page Title” on my homepage?”. This is often asked in situations where a static page is being used for the Home Page. The following is three four easy methods you can use to solve this problem:

1) Hide the Page Title with CSS

This is the most common method I see being used, but not my favourite. It works by creating a class in your theme’s style.css file, something like this:

h1#post-63 {display:none;}

You should replace the “post-63″ bit to match the ID of your own WordPress page ID. (TechTrot explains how to find your page ID here). This works great but personally I’ve never been a fan of hidden text.

2) Remove the Page Title with a WordPress query

Using the WordPress conditional tag “is_front_page()” you can make your WordPress theme check if the current page is the “home page” or as WordPress calls it “the front page”.

The query you should place into your theme’s page.php file looks something like this:

<?php if (is_front_page()) : ?>

<?php else : ?>
<h1 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h1>
<?php endif; ?>

In the example above you could display for example an image instead of the Page Title, but for me I generally keep it blank.

3) Change the Page Title with a Plugin

A plugin I love using is the very powerful Page Lists Plus. With this plugin you can control the Page Title text that is displayed in your navigation menu (Page lists generated by wp_list_pages()). This becomes very handy, as it means your Static WordPress Page Title of your homepage could be “Welcome to my website!” but in the Page Lists Plus plugin you can use the alternate text field with “Home”.

WordPress - Page Lists Plus plugin

It’s not always perfect but can be very handy not only in this use but for other situations too.

4) Delete the Page Title with Page Templates

As noted in Saban’s comment, you could create a Page Template that excludes the_title() all together.

As a rough guide to do this, follow these steps:

  1. Go to your theme directory via FTP, download and make a copy of the page.php file and rename it to something like “page-notitle.php

  2. Open the page-notitle.php file and add to the very start of the document some code to identify it as a template:

    <?php
    /*
    Template Name: Homepage (No Title)
    */
    ?>
  3. Next, browse through the document until you find the_title() – this is the area that displays the page title. For example, it would be fine to remove the following (but your theme may differ!):

    <h1 class="title"><?php the_title(); ?></h1>
  4. Save and Upload your new page-notitle.php file to your theme directory.

  5. Now return to your WordPress admin area and edit the page you’re using for the homepage. On the right hand side under the Publish panel you’ll see Page Attributes > Template, and select the “Homepage (No Title)” option. Update the page and you’re all done.

With this method you have a page template that can also be used in other area’s of your website.

What Do I use?

I’ve used all of the above methods over various websites, but most recently I’ve been aiming to removing the Page Title completely via the conditional tag method (#2). The best solution for you will depend on your web design, layout and structure.

If you have another method I’d love to hear about it via comments below :)

Tags: ,


Author | Leon Poole

Leon Poole is owner and founder of the Brisbane Web Design company Creative World. He has a passion for designing websites, solving problems and improving the user experience. You can follow me on Twitter or Google+.

25 Responses to How to remove the “Page Title” from your WordPress Homepage

  1. SUPER SIMPLE ANSWER: If you do not want to display a title on your static page, try this:

    1. Add New Page

    2. Type some text, anything, in the body of the page.

    3. DO NOT PUT ANYTHING IN THE TITLE BOX

    4. Publish

    5. Then go down to the SEO boxes and type in your ‘secret title’

    6. Hit Update.

    You’re done. No messing around with PHP and codes.

    AND when you view ‘All Pages’ your ‘secret title will show up and you can more quickly go to that page if you want to edit.

  2. Thanks so much for this post! The WordPress Query option worked like a charm. Thank.

  3. Great steps! But unfortunately, the plugin didn’t work for me. Is it because of the WordPress version?

    • Which plugin are you using? The Page Lists Plus plugin should still work with the latest version of WordPress (even though the plugin hasn’t had an update for a while now).

  4. I installed the page list plus, its working properly and it could do what i needed. Thank you so much

  5. Analog to this post http://www.mimoymima.com/2010/03/lab/disable-sidebar the idea is to disable the title for each page/article using custom fields.

    To do so replace in your page.php

    with

    ID, ‘disableTitle’, $single = true);
    if ($disableTitle !== ‘true’) { the_title(); } ?>

    Now edit your page/article and add a Custom Field (In newer >3 Worpress version you have to enable them first here: http://codex.wordpress.org/images/d/d8/screen_options.jpg )

    under Name enter : disableTitle
    under Value enter : true

    The title will be disabled for this page/article and this page/article only:)
    MiK


    • ID, 'disableTitle', $single = true);
      if ($disableTitle !== 'true') { the_title(); } ?>

    • Hi Mik,

      Great idea. This method is probably a little less user friendly than most people would like, but it is another valid way to remove the title from the homepage and will give the WordPress owner more control over which pages the title is displayed on site-wide.

      I think I’ll have to add a 5th option now :)

      Cheers

  6. Eine saubere Alternative (Die Idee kommt von diesem Tip: http://www.mimoymima.com/2010/03/lab/disable-sidebar/)

    In der page.php

    statt: <?php the_title();

    .

    ID, 'disableTitle', $single = true);
    if ($disableTitle !== 'true') { the_title(); } ?>

    Dann auf der betreffenden Seite/Artikel ein Benutzerdefiniertes Feld anlegen
    und folgendes unter Name eintragen

    disableTitle

    Wert auf

    true

    setzen

    Der Titel is gone :)

  7. Fernando says:

    Hi, I want to use method 2.
    But in wich part of page.php I need to put the code?
    And can I use the code to change another pages’ titles to images?

    • The code in Method #2 needs to replace the existing < ?php the_title(); ?> that will most likely be in your theme’s page.php file. WordPress themes have evolved a lot over the last year, you may need to look for a file like loop-page.php etc. Hope this helps.

      • Your code in #2 works well to strip the title from the home page (though it would have been nice not to have to hunt through the comments to find out where the code went–not all of us are php-savvy, and if we were, we wouldn’t be here!). Unfortunately, it has also removed it from every other page, forcing the title awkwardly down into the text area instead.

        I can’t for the life of me figure out which setting in Page Lists Plus is supposed to do this for me, either. I want to REMOVE the title, not have a different one in my navigation menu, so I guess this is not what I want either, which is disappointing, because yours is the most comprehensive post I’ve found and I’m still at a loss. I guess I’m left with option 1.

        Why the hell is it so hard to do something that should be so basic??

  8. Why all this headache guys.. you have to note 2 important things newly occured with WordPress
    1 – title was h2.. now is h1 tagged.
    2 – If you want to hide a title of a single page you DONT NEED A PAGE TEMPLATE!!
    here’s how go to html edit view of the page. and hide h1 with this
    h1 {display: none;} THATS IT!!!!

    3 – If you want to hide all titles from all pages and posts..
    edit ( page.php )

    notice that in WP, whether it’s a page or post.. it’s always a “post” in code

    and comment out ( NOT DELETE THE FUCHIN CODE!! )

    Find this or similar code inside

    <a href="” rel=”bookmark” title=””>

    comment it out like this

    <!–

    <a href="” rel=”bookmark” title=””>

    –>

    >_>

    • Hello Dinoraptor – No headaches here, just listing the different ways to accomplish the same thing :)

      Re: point 2 – this method is mentioned as Method #1 above. Your example would make ALL

      tags removed, probably not a great idea.

      Re: point 3 – this is pretty much the same as Method #2 above. Of course if you wanted to remove the title complete from all pages then yes, just delete < ?php the_title(); ?> from your theme’s page.php file.

  9. I just deleted the title in edit mode seemed to work just fine. Since it the home page i have the site title at the top anyhoo so no worries

    • This is what I have done on both of my websites (different themes) with no problems. These other ways seems so complicated. Maybe I’ll regret it in the future?

    • Creating a custom page template only for the homepage wouldn’t be my first choice to simply ‘remove’ the homepage title – however it is a valid option! Thanks and I’ll add it to the list.

  10. This is not working!

    I tried #1, #2 & #3 but none of it works!

    plugin gives errors on word press 3~

  11. Useful information and for us the Point 1 is the most easiest way to implement. We was working for a client project and was looking forward to this information. Thanks again for your contribution.

    Regards,
    Sandy

  12. I can’t get method #2 to work. I just tried putting this above all other content on page.php. Is that correct?

    How do I define that it is the front page. Is it the static page set under the Reading setting of WordPress?

    Thanks.

    • Yes – you need to define the static front page so WordPress knows what is_front_page (home page) is. Set the static homepage by going to Settings > Reading and select the page for the Front page and Posts page.

      You could also use is_home() that will check if the current page is the home page regardless of what is set under Settings > Reading.

  13. I added h1#post-15 {display:none;} to my style.css file and it did not remove it.The 15 is my home page any suggestions.

    Mark

Leave a Reply...

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>