Support » Fixing WordPress » How to hide pages from my categories

  • 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.]

  • The topic ‘How to hide pages from my categories’ is closed to new replies.