• Resolved simonclay

    (@simonclay)


    When I select ‘Exclude From Search > True’ my CPT archive page doesn’t show and Posts in Archives, or Categories.

    Is that the expected behaviour? I thought setting ‘Exclude From Search > True’ would just stop it showing in search results?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi @simonclay

    Very curious.

    To help attempting to verify, I created a “movie” post type, set it to have archive = true, saved 2 posts in the post type, and then visited the archive and it showed both.

    I then edited the post type settings in CPTUI and set exclude from search = true and refreshed the archive and they both still showed up. Archive URL is wds.test/movie/ So its own archive is still working for me locally.

    Regarding category archives, by default WordPress doesn’t include custom post types in those, and we have some documentation to show how to get them added to category/tag archives if you want the links to that.

    Thread Starter simonclay

    (@simonclay)

    Hey, thanks for checking and replying so quickly.

    Actually Posts are showing in Archives for me, with ‘Exclude From Search > True’
    eg. /test_post_type/ and single: /test_post_type/test-post-2/

    But visiting A category listing for that CPT doesn’t list the posts of that category. Eg. /test_categories/maple/ but it does when set to ‘Exclude From Search > False’

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Making sure I’m seeing things correctly here. Bear with me a moment. ??

    “test_post_type” is your post type slug, and then “test-post-2” is a post in that post type. Correct?

    Then

    “test_categories” is a custom taxonomy, and then “maple” is a term in that taxonomy. Correct?

    Then

    “test_post_type” has the “test_categories” taxonomy associated with it, and “test-post-2” has the term “maple” assigned. Correct?

    Then, the problem is is that when viewing the maple archive, “test-post-2” is not being listed. Perhaps you’re seeing the “no posts found” messaging, something like that?

    Thread Starter simonclay

    (@simonclay)

    Thanks so much. answer to your questions is yes.

    But I’m a bit confused by your last statement. I will create a test site and share a link.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Basically for the last part, it’s not a PHP error or some sort of site breaking error, just that there were no posts found to display within the current request.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Upon some digging, I found these two links:

    https://alexmansfield.com/wordpress/custom-post-types-custom-taxonomy-archive/

    https://wordpress.stackexchange.com/questions/223547/custom-post-types-not-showing-on-custom-taxonomy-archive-page

    First one shows someone doing some quick blogging about the topic, and the second one is the mentioned StackExchange about the topic and shows some WordPress core things going on that explain why this happens. So, nothing that CPTUI is doing incorrectly, just WordPress being difficult ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Exclude From Search prevents Archive listing’ is closed to new replies.