WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have a static paged website and I want to make pages without title, but I still need the titles for the navigation to pick it up. How can I get rid of the Page.php (the_post()) from displaying the page title?

share|improve this question
up vote 1 down vote accepted

Somewhere in your page.php template will be a tag containing the_title(), and that's what you have to delete. In my Wordpress theme, for example, the code looks like this:

<?php if ( have_posts() ) : ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <div class="entry">
        <div <?php post_class(); ?>>
            <div class="post-meta">
                <h1><?php the_title(); ?></h1>

That last line is the one you need to get rid of. You can simply delete it and the post title will be removed from all Pages.

Note: If you have a theme like Twenty Eleven that does not contain the <?php the_title(); ?> tag inside page.php, you'll have to follow the clues from page.php to find out where the template is coming from. In the case of Twenty Eleven, page.php simply contains

<?php the_post(); ?>

<?php get_template_part( 'content', 'page' ); ?>

and no template tags at all. The clue is the get_template_part(): that tells us that page.php is pulling from a file called content-page.php. Look in the Twenty Eleven folder and you'll find content-page.php there for your editing pleasure. And sure enough, it contains this line:

<h1 class="entry-title"><?php the_title(); ?></h1>

Delete that and you're good to go.

share|improve this answer
haha thanks! Why would they split that little code into 2 files that's just over complicated IMO. – Howdy_McGee Sep 20 '11 at 21:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.