How To Remove Specific Pages From Custom Post Type Archive

This code enables you to remove one or more pages from your custom post type archive page loop.

Simply add the code to your child themes functions file and replace the post I.D in the following code with your own post I.D or comma separated post I.D’s for the pages you want to exclude from the archive.

You’ll also need to swap out the name of the CPT (portfolio) with your own.

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.