In WordPress, the title of a page or post is usually one of the central elements displayed on your website. The title helps your readers to understand the content and provides search engines with important information. However, there are situations where it can be useful to hide the title, whether for aesthetic reasons or to better match the design of a particular page. In this blog post, I’ll explain how you can easily hide page and post titles in WordPress.
Why hide the title? #
There are various reasons why you might want to hide the title of a page or post in WordPress:
- Design customizations: Sometimes the title does not match the rest of the page design, especially if you are using special layouts or templates.
- Landing pages: On landing pages or special sales pages, you may want to focus on specific content and display the title inconspicuously or not at all.
- Avoid repetition: If the title of a post or page already appears in a headline or other prominent element, it may be unnecessary to display it again.
Regardless of the reason, there are various methods you can use to hide the title in WordPress.
Method 1: Hide the title with a plugin #
For users who do not have any technical knowledge, using a plugin is the easiest way to hide titles. There are numerous plugins that allow you to do just that.
Recommended plugin: “Hide Title” #
- Installation:
- Go to “Plugins” > “Install” in your WordPress dashboard.
- Search for the “Hide Title” plugin and install it.
- Activate the plugin.
- Use:
- Edit the page or post where you want to hide the title.
- You will see a new option in the editing area that allows you to hide the title (usually a simple checkbox).
- Activate this option and save the page or post.
This plugin is ideal for users who want to quickly and easily hide titles on certain pages or posts without having to deal with code.
Method 2: Hide titles via custom CSS #
If you prefer not to install additional plugins or prefer an individual solution, you can also hide the title using custom CSS. This method requires some technical understanding, but is flexible and efficient.
This is how it works: #
Go to “Customizer”:
Open your WordPress dashboard and navigate to “Design” > “Customizer”.
Add custom CSS:
Click on “Additional CSS” in the Customizer.
Add the following code to hide the title on all pages and posts
.entry-title { display: none; }
Note: The code .entry-title
is the general CSS selector for the title in most WordPress themes.
If your theme uses a different name, you will need to find out the correct selector.
You can check this with your browser’s developer tools.
Save the changes: After you have added the CSS, click on “Publish” to save the changes.
Hide titles only on certain pages or posts: #
If you only want to hide the title on a specific page or post, you can use the page or post ID. For example:
.page-id-123 .entry-title { display: none; }
Replace 123
with the actual ID of the page or post on which you want to hide the title.
Method 3: Hide titles in your theme template #
For advanced users who have direct access to the source code of their WordPress website, it is possible to remove the title directly in the theme files. This method requires editing the template files of your theme.
Create a child theme:
To ensure that your changes are not overwritten by theme updates, you should first create a child theme. This protects your customizations from future losses.
Edit the template files:
Open the file page.php
or single.php
(depending on whether you want to hide the title on a page or a post) in your theme directory.
Search for the line that shows the title of the post. This often looks like this:
<h1 class="entry-title"><?php the_title(); ?></h1>
Delete or comment out this line:
<!-- <h1 class="entry-title"><?php the_title(); ?></h1> -->
Attention: #
Editing the theme files directly can be risky if you are not careful. It is always a good idea to make a full backup of your website before making such changes.
Conclusion #
Hiding titles in WordPress can be achieved in different ways, depending on your needs and technical know-how. Whether you choose the easy way via a plugin, use CSS for a more flexible solution or work directly on the theme code – each method has its advantages and disadvantages.
For beginners, I recommend using a plugin, while experienced users can explore the possibilities of customization via CSS or editing the template files. Good luck hiding the titles and customizing your WordPress website!
Comments