Disable title generate on specific category or page
-
Hello!
I have another title tag autogen filter plugin for product category.
I want delete meta title tag.
Previously it was possible to remove meta title with this code:
add_filter( 'wpseo_title', 'remove_category_wpseo_title' ); function remove_category_wpseo_title( $title ) { if ( is_product_category() || is_shop() ) { return false; } return $title; }But now is not working.
I found in dev portal, but this code delete all meta data.
add_action( 'template_redirect', 'remove_wpseo' ); /** * Removes output from Yoast SEO on the frontend for a specific post, page or custom post type. */ function remove_wpseo() { if ( is_product_category() || is_shop() ) { $front_end = YoastSEO()->classes->get( Yoast\WP\SEO\Integrations\Front_End_Integration::class ); remove_action( 'wpseo_head', [ $front_end, 'present_head' ], -9999 ); } }How can I delete meta title tag from product category?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Disable title generate on specific category or page’ is closed to new replies.