How to hide meta from search result only on pages? September 23, 2022 by Tarik Billa You can use this inside the WordPress loop: if (get_post_type() == 'post') { // do something }