Jump to content

Fetch all published and hidden pages with 200 response code


---
 Share

Recommended Posts

I've got this code to fetch all pages:

/** @var PageArray $pages */
        $pages = $this
            ->wire('pages')
            ->find(sprintf(
                'has_parent!=2,id!=2|7,status<%s',
                Page::statusTrash
            ));

With this I fetch all pages except admin, but that includes the 404 page as well. Is there a way to exclude pages like the 404 page from the result? Or maybe loop through the result set to check for the pages response code (without curl that is)?

I want to avoid filtering the 404 page by ID if possible.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...