• Resolved broksonic

    (@broksonic)


    We have code like this:

    With WordPress 5.6, it correctly showed the redirected page as well as showed Titles/Descriptions from Yoast.

    As soon as we upgraded to WordPress 5.7, Yoast no longer shows it’s SEO overrides in this case – instead we get random products displayed as title and description (and open graph).

    function product_category_override() {
    	global $wp_query;
    
    	if ( is_product_category() ) {
    		$page_override = get_field( 'page_override', 'category_' . get_queried_object()->term_id );
    
    		if ( $page_override ) {
    			$wp_query = new WP_Query( [ 'page_id' => $page_override ] );
    		}
    	}
    }
    add_action( 'template_redirect', __NAMESPACE__ . '\product_category_override' );
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    We are sorry to hear that you’re having trouble after updating WordPress and Yoast SEO to the latest version. If the relevant code works on WordPress v5.6 but not in WordPress v5.7 while all the non-Yoast plugins are disabled and the default 2021 theme is active, we’d like you to please submit a proper bug report to the Yoast SEO GitHub development repository so our development can investigate this further for you.

    Thread Starter broksonic

    (@broksonic)

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Thanks for submitting the relevant issue to GitHub. You can follow the relevant issue to see the updates from our team. Someone from our development team will get back to you on this over there!

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

    Thread Starter broksonic

    (@broksonic)

    Thanks. This is resolved via the Github ticket and a new release from Yoast, so all good!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WordPress 5.7+Yoast: WP_Query override breaks SEO titles/description’ is closed to new replies.