• Hello,

    Please add an option to remove the custom post type created for FAQs, so we don’t have a lot of pages (www.domain.com/ufaqs/*) with a small amount of text.

    Thank you for your great plugin

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter charafweb

    (@charafweb)

    For now I’m using this code in functions.php to disable the CPT:

    function alter_ultimate_faq_cpt( $args, $post_type ) {
    	// If not Products CPT, bail.
    	if ( 'ufaq' == $post_type ) {
    		$ultimate_faqs = array(
    			'exclude_from_search' => true,
    			'publicly_queryable' => false,
    			'query_var' => false,
    			'has_archive' => false,
    			'rewrite' => false,
    			'show_in_rest' => false
    		);
    		return array_merge( $args, $ultimate_faqs );
    	}
    	else {
    		return $args;
    	}
    
    }
    add_filter( 'register_post_type_args', 'alter_ultimate_faq_cpt', 10, 2 );

    Hi chara,

    I’m assuming you mean remove the single post pages? The custom post type is the whole basis for the plugin. With no custom post type, there would be no FAQs. So, you definitely cannot remove the custom post type.

    Additionally, that’s how all posts in WordPress work. They all create an individual post page for each post you create. Doesn’t matter whether it’s the default Posts post type or any custom post type.

    If you’re just worried about those pages being crawled, then just use your robots.txt file or a plugin to prevent them from being indexed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Request] No CPT please’ is closed to new replies.