How to hide pages from my categories (1 post)

  1. carlos2928
    Posted 2 years ago #

    Hi there, i waant to know how to hide my pages frommy search results on my website and olso from the categories too .. y tryed adding this code in my functions

    add_action('admin_footer', 'custom_admin_js');
    function Filtro($query) {
    if ($query->is_search) {
    $query->set('post__not_in', array(467,471,473,477));
    return $query;

    It works but on my footer admin dashboard appears a
    warning.. please help

    [Entire post and topic decapped - please do not use all caps - it's considered yelling and is against the forum guidelines. You also need to use the code buttons for posting code - fixed that as well.]

Topic Closed

This topic has been closed to new replies.

About this Topic