How to Hide Featured Image in WordPress Post

0
284
How to Hide Featured Image in WordPress Post

In this article, you going to see how to hide featured image in WordPress post in details and step by step.

If you are looking for this topic then you are at right place for hiding featured image.

Let’s start with the discussion regarding how to hide featured image in WordPress post.

How to hide featured image in post WordPress code?

There are different way to hide the featured image in individual post.

Now you going to see hide image using code.

It is very simple for hiding of image using code.

To quick and most efficient way, to hide permanently your feature images of all posts in WordPress, please follow below step.

Step one is to add the following PHP code to the functions.php template e.g. under the child theme.

Clear cache and save the file.

Below is code snippet which you have to use.

function wordpress_hide_feature_image( $html, $post_id, $post_image_id ) {
  return is_single() ? '' : $html;
}
// add the filter
add_filter( 'post_thumbnail_html', 'wordpress_hide_feature_image', 20, 4 );

How to hide featured image WordPress CSS?

One more method you can use to hide image is via using CSS.

It is very simple to do it using CSS.

Find the appropriate class of the image div and add a display none condition in your style sheet.

When you are in browser, Click on Inspect element and check the class of the featured image

You can go to additional CSS and just type the class name and enter display: none

Below is example of code snippet for CSS.

.thumbnail{display:none}

or

.post-tumbnail{display:none}

How to remove featured image from body of post?

To remove featured image follow below steps.

First logging to WordPress admin and go to the post section by clicking on the left side top corner.

When you go inside your post page in admin section and down on the right hand side towards the bottom you will see your featured image inside document tab section.

Click on remove featured image to remove, then update. This will remove it from your post, but the image will remain in your media library.

If you want permanently remove then go into media section.

Find the image, then click on it.

On right hand side bottom you will see delete link to delete.

In one can remove feature image.

Why hide featured image plugin not working?

In latest version of WordPress, Check the Hide featured Image Plugin is compatible or not.

If it is not, then go for installation.

And If it is installed and not working then please uninstall and deactivate and delete it.

If don’t want featured image, then don’t add a featured image to the post. This way no featured image will show for that post.

What is WordPress and How does it Work

Conclusion :

Finally we done with the point of hiding featured image.

I hope you like this article and if you think that i have missing something, please comment below.