Disable Featured Images in Twenty Nineteen Theme without CSS

Of course everything is possible to hide with CSS 😁 But it isn’t a solution, is it?

The solution is as simple as a single line of code:

 * @snippet       Disable Featured Images in Twenty Nineteen WordPress theme
 * @sourcecode    https://rudrastyh.com/?p=8383
 * @author        Misha Rudrastyh
add_filter('twentynineteen_can_show_post_thumbnail', '__return_false');

This code will hide featured images in:

Where to insert this code? You can create a custom plugin and paste that line of code in it or you can use it in functions.php file of a child theme (I used this way).

Seems too difficult? Download my plugin.

Of course functions.php inside Twenty Nineteen theme itself is not recommended, it will work only until the first theme update.

Maybe it is Better to Remove Featured Images from Every Post?

Yep, it is an option too! But what to do if you have hundreds of posts?

Easy-peasy! All you have to do is to run this SQL query in your database phpMyAdmin:

DELETE FROM wp_postmeta WHERE meta_key = '_thumbnail_id';

Should I remind you that you have to always backup your database before running any queries in it? And do not forget to replace the wp_ if you’re using a custom database prefix.

Misha Rudrastyh

Misha Rudrastyh

I develop websites since 2008, so it is total of 13 years of experience, oh my gosh. Most of all I love love love to create websites with WordPress and Gutenberg, some ideas and thoughts I share throughout my blog.

Need some developer help? Contact me

Follow me on Twitter