PHPMatters Help You Better Hosting Your PHP-based Sites
How to Hide a Post or Page Title in WordPress

How to Hide a Post or Page Title in WordPress

There are cases that you may want to learn how to hide a page title or post title from the display of your WordPress site. You need to use a custom page as the homepage instead of the default design the theme uses, for example. Or you might also use a page as the landing page. No matter which case you are faced with, the page title could be an obstacle of the custom design.

There are several different ways to remove the titles of WordPress posts and pages, and we will introduce them one by one so that you can make a decision by yourself.

Hide Post or Page Title in WordPress by Editing the Stylesheet

Editing the stylesheet may sound complicated for beginners, but you don’t need to worry because this method is simple and flexible. And as an extra benefit, you can have a basic understanding about some CSS rules.

Step 1: Find the CSS class used for post and page titles.
The first task you need to do is to find the name of the CSS class that the theme uses for post and page titles. The quickest and easiest way for doing this is to open a published page or post, navigate to the title, right click on the mouse and choose to “inspect element”. Among the elements, find the post/page title and you will see the class in the h1 tag.

Find Title Class Name

The class used on this site is “entry-title“. If yours is the same, then you can just copy the code we give in this post. But you need to remember that the class can be different depending on the theme you use. Once you get it, keep it in mind as you will use it.

Step 2: Get the post or page ID.
Before dealing with any code, you also need to find out the ID of the post/page of which you want to hide the title. You can find the ID on the editing screen of the post/page, or you can also get some clues in the elements near to the place where you have found the title class name.

Find Post/Page ID

Step 3: Edit stylesheet and insert CSS code.
Here comes the most important part. Now log into WordPress dashboard, go to Appearance > Editor, and find Stylesheet (style.css). Insert the code you need to the file.

  • For page:
    .page-id-7018 .entry-title {display: none;}
  • For post:
    .post-8272 .entry-title {display: none;}

You should change the ID and the class name .entry-title to your own, and do not miss any dot. Once you paste the code in the file, save it and refresh the post/page to see whether the title has disappeared.

Hide the Titles of All Posts/Pages
It is not commonly seen that someone would hide all post/page titles, but the case indeed exists. So we discuss the code too, for the sake for help and learning also.

  • For all pages:
    .type-page .entry-title {display: none;}
  • For all posts:
    .type-post .entry-title {display: none;}

An Alternative – Use a Plugin

Of course, you can also hide post or page titles by leveraging the power of WordPress plugins. But we would recommend this method less unless you do not want to touch any line of code. Too many plugins not only slow down your site, but also bring more vulnerabilities which weaken WordPress security.

If you have made up your mind, you will need to download Hide Title plugin. Once upon activation, you can see a new meta box on the right side of the editing screen of posts and pages. Checking the box, you can hide the title of the post/page on singular page views.

Hide Title Plugin

Using the plugin does not hide the titles from homepage and other archive pages but only on single page views. It is quite simple and helpful for making a custom landing page without a title shown.