How To Hide WordPress Featured Image In Post Index Page

Each WordPress post has a featured image, and the featured image will be shown on the WordPress home page above each post title. But at some time this image is not necessary and will cost page load time, so we need to hide it on the WordPress home page to increase page load speed. This article will tell you how to implement it by editing WordPress source code.

1. Hide WordPress Post Featured Image In Index Home Page Steps.

Below are the steps to hide the featured image on the WordPress home page, it will edit the theme source code. It does not need to install any third party plugin. Use a plugin will make your WordPress website run slowly.

  1. Login to WordPress dashboard.
  2. Click the Appearance —> Theme Editor menu item on the left side navigation pane.
  3. On the page right side, select the theme from the drop-down list Select theme to edit, then click the Select button to select it.
  4. Then navigate to the content/content.php file in the right side Theme Files area.
  5. Click the content.php file to edit it’s content and remove the code <?php get_the_image(......)?> which will display the featured image as below.
    <?php else : // If not viewing a single post. ?>
    <!-- comment below code to not display post featured image in index page to improve page speed. -->
    <!--?php get_the_image( array( 'size' => 'stargazer-full', 'order' => array( 'featured', 'attachment' ) ) ); ?-->

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.