How to hide featured image in wordpress post

Last Updated: Jan 22, 2024 by

If you’re a WordPress user, you may have encountered the issue of wanting to hide the featured image on a specific post or page. Whether it’s for aesthetic purposes or to avoid duplicate images, there are various reasons why you may want to hide the featured image on your WordPress site.

In this article, we’ll explore different methods for hiding the featured image on a WordPress post and provide step-by-step instructions for each method.

Why Hide the Featured Image?

Before we dive into the methods for hiding the featured image, let’s first understand why you may want to do so.

Aesthetic Purposes

One of the most common reasons for hiding the featured image is for aesthetic purposes. You may have a specific layout or design for your post or page that doesn’t include the featured image. In this case, hiding the featured image can help you achieve the desired look for your content.

Avoid Duplicate Images

If you have a featured image set for your post, it will automatically appear at the top of your post or page. However, if you also have the same image inserted within the content of your post, it can create a duplicate image, which may not be ideal for your site’s design or loading speed.

Personal Preference

Some WordPress users simply prefer not to have a featured image displayed on their posts or pages. This could be due to personal preference or to maintain a clean and minimalistic design.

Method 1: Using a Plugin

The easiest way to hide the featured image on a WordPress post is by using a plugin. There are several plugins available that allow you to hide the featured image on specific posts or pages. One popular option is the “Hide Featured Image” plugin.

Step 1: Install and Activate the Plugin

To get started, go to your WordPress dashboard and navigate to “Plugins” > “Add New”. In the search bar, type in “Hide Featured Image” and click on the “Install Now” button next to the plugin.

Once the plugin is installed, click on the “Activate” button to activate it on your site.

Step 2: Hide the Featured Image

WordPress pluginby Anshu A (https://unsplash.com/@anshu18)

Now that the plugin is activated, go to the post or page where you want to hide the featured image. Scroll down to the “Hide Featured Image” section, which should be located below the content editor.

Check the box next to “Hide Featured Image” and click on the “Update” button to save your changes. The featured image will now be hidden on that specific post or page.

Method 2: Using CSS Code

Another way to hide the featured image on a WordPress post is by using CSS code. This method requires a bit more technical knowledge, but it is a great option for those who don’t want to use a plugin.

Step 1: Find the Post ID

To get started, go to the post or page where you want to hide the featured image. In the URL bar, you will see the post ID at the end of the link. Take note of this ID as you will need it for the next step.

Step 2: Add CSS Code

WordPress CSS codeby Jay Wennington (https://unsplash.com/@jaywennington)

Next, go to your WordPress dashboard and navigate to “Appearance” > “Customize”. In the left sidebar, click on “Additional CSS” to open the CSS editor.

In the editor, add the following code:

.postid-123 .entry-thumbnail { display: none; }

Replace “123” with the post ID you noted in the previous step. This code will hide the featured image on the post or page with that specific ID.

Click on the “Publish” button to save your changes.

Method 3: Using a Child Theme

If you’re familiar with creating child themes in WordPress, this method may be the best option for you. It involves adding a small snippet of code to your child theme’s functions.php file.

Step 1: Create a Child Theme

If you don’t already have a child theme set up, you can create one by following these steps:

  1. Create a new folder on your computer and name it “child-theme”.
  2. Create a new file inside the folder and name it “style.css”.
  3. Add the following code to the top of the style.css file:

/* Theme Name: Child Theme Template: twentytwenty */

  1. Save the file and create a new file named “functions.php”.
  2. Add the following code to the functions.php file:
  3. Save the file and compress the “child-theme” folder into a zip file.

Step 2: Install and Activate the Child Theme

WordPress child themeby Westwind Air Service (https://unsplash.com/@westwindairservice)

Now that you have a child theme, you can install and activate it on your WordPress site. To do this, go to “Appearance” > “Themes” and click on the “Add New” button at the top of the page.

Click on the “Upload Theme” button and select the zip file you created in the previous step. Click on the “Install Now” button and then click on “Activate” once the theme is installed.

Step 3: Add Code to Functions.php

Next, go to your WordPress dashboard and navigate to “Appearance” > “Editor”. In the right sidebar, click on “Theme Functions (functions.php)” to open the functions.php file for your child theme.

Add the following code to the bottom of the file:

function hide_featured_image() { if ( is_single() ) { echo ”; } } add_action( ‘wp_head’, ‘hide_featured_image’ );

This code will hide the featured image on all single posts on your site. If you only want to hide the featured image on specific posts or pages, you can modify the code to include the post ID, similar to the CSS code method.

Click on the “Update File” button to save your changes.

Conclusion

Hiding the featured image on a WordPress post or page can be achieved in various ways. Whether you prefer to use a plugin, CSS code, or a child theme, these methods can help you achieve the desired look for your site and avoid duplicate images.

By following the step-by-step instructions in this article, you can easily hide the featured image on your WordPress site and improve its overall design and functionality.

Moadood Ahmad

About the Author: Moadood Ahmad

Leave a Reply

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