• Resolved padylee

    (@padylee)


    Hello,
    I have created a Custom Post Type. This Custom Post Type has a Title, a Featured Image and otherwise only Custom Fields.
    I have set the “Exclude From Search” setting of the Custom Post Type to false. So I assume that the posts of the Custom Post Type will also be found by the search function. However, they are not.
    Does anyone have any idea why the Custom Post Type posts are not found via the search function?

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

    (@tw2113)

    The BenchPresser

    Can you paste me the blob of content from the CPTUI > Tools menu and the Post Type tab? I’d like to review all of the settings, and see if I can recreate on my own.

    Thread Starter padylee

    (@padylee)

    Hi Michael,
    i hope thats what you need:

    			
    		### Begin Custom Post Type UI Debug Info ###
    
    		Multisite:                No
    
    		WordPress Version:        5.9.1
    		Permalink Structure:      /%category%/%postname%/
    		Active Theme:             Bricks Child Theme 1.0
    
    		Registered Post Types:    post, page, attachment, revision, nav_menu_item, custom_css, customize_changeset, oembed_cache, user_request, wp_block, wp_template, wp_template_part, wp_global_styles, wp_navigation, acf-field-group, acf-field, uebungen-short, bricks_fonts, bricks_template
    
    		PHP Version:              7.4.28
    		MySQL Version:            5.7.37
    		Web Server Info:          Apache
    
    		Show On Front:            page
    		Page On Front:            Startseite (#24392)
    		Page For Posts:            (#0)
    
    		WordPress Memory Limit:   40MB
    
    		TOTAL PLUGINS: 9
    
    		ACTIVE PLUGINS: (7)
    
    		Advanced Custom Fields PRO: 5.11.4
    		Bricksable: 1.4.2
    		Custom Post Type UI: 1.10.2
    		Duplicate Page: 4.4.8
    		LuckyWP Table of Contents: 2.1.4
    		Rank Math SEO: 1.0.83
    		WP Grid Builder: 1.6.4
    
    		INACTIVE PLUGINS: (2)
    
    		Borlabs Cookie - Cookie Opt-in: 2.2.45
    		WP Rocket: 3.10.7
    
    		Post Types: 
    		{"uebungen-short":{"name":"uebungen-short","label":"\u00dcbungen Shorties","singular_label":"\u00dcbungen Shorty","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"true","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","thumbnail"],"taxonomies":["muskelgruppe"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""}}
    
    		Taxonomies: 
    		{"muskelgruppe":{"name":"muskelgruppe","label":"Muskelgruppen","singular_label":"Muskelgruppe","description":"","public":"true","publicly_queryable":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"1","show_admin_column":"true","show_in_rest":"true","show_tagcloud":"false","show_in_quick_edit":"true","rest_base":"","rest_controller_class":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":"","back_to_items":""},"meta_box_cb":"","default_term":"","object_types":["uebungen-short","fitness-uebungen"]},"ziel":{"name":"ziel","label":"Ziele","singular_label":"Ziel","description":"","public":"true","publicly_queryable":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"1","show_admin_column":"true","show_in_rest":"true","show_tagcloud":"false","show_in_quick_edit":"true","rest_base":"","rest_controller_class":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":"","back_to_items":""},"meta_box_cb":"","default_term":"","object_types":["uebungen-short"]},"geraete":{"name":"geraete","label":"Ger\u00e4te","singular_label":"Ger\u00e4t","description":"","public":"true","publicly_queryable":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"1","show_admin_column":"true","show_in_rest":"true","show_tagcloud":"false","show_in_quick_edit":"true","rest_base":"","rest_controller_class":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":"","back_to_items":""},"meta_box_cb":"","default_term":"","object_types":["uebungen-short"]}}
    
    		### End Debug Info ###
    				
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    wasn’t quite, but coincidentally this also has the exact same information I was wanting, so definitely good enough.

    Stay tuned

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm. So I imported you settings, and created a quick post in the post type with a title of “Shorty”.

    Did a search for it via mysite.com/?s=shorty and it showed up in the results.

    Do you have any other plugins/customizations around searching on the site that may be interfering here? Or perhaps a 3rd party search integration like Algolia/ElasticSearch/etc ? SearchWP?

    By default, I believe WordPress does a search in the post content and post title. Which explains why mind came up with a result.

    Thread Starter padylee

    (@padylee)

    Thanks for the quick reply.
    That is strange.

    My custom posts have no content.
    I only use the title and post image >> https://nimb.ws/eycxOl

    Additionally a few fields via ACF.
    >> https://nimb.ws/ehZU8I

    The Custom Posts are completely empty when I preview them. They only consist of header and footer.
    >> https://nimb.ws/6mhMjn

    Maybe WordPress recognizes that these page are not useful and doesn’t show them in the search results?

    Edit:
    And no, I didn’t do any other plugins or anything with the search function. The installation is pretty fresh.

    • This reply was modified 2 years, 12 months ago by padylee.
    • This reply was modified 2 years, 12 months ago by padylee.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    WordPress search, from what I’ve always seen is pretty non-opinionated. It’s not going to in some way judge “worth” or “usefulness”. Just a matter of “does the title or content area have the searched term anywhere in them? Yes! show it. No! Move on to the next thing”

    What comes up, if anything, for a search of beinpresse.

    Also is it possible that your search results template isn’t completely created yet? Perhaps you are getting results, but it’s just not coded out correctly to show the results themselves?

    Thread Starter padylee

    (@padylee)

    Thank you very much! There was the error.
    I have a filter in the search results output that says only WP posts should appear and no custom posts.

    Thanks for the great help!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome. Glad you got this working now.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘exclude from search: false = not working’ is closed to new replies.