Ecommerce Shopify WordPress Discussion

How to use Yoast SEO Premium properly

The Yoast plugin creates its own redirect map when the URLs of published posts are changed. We need a function that will run after changes are made to the redirect map. But for some reasons, I can't make it work even I have a lot args // This throws an error with: Uncaught ArgumentCountError: Too few arguments to function handle_yoast_term_redirect_slug_change(), function handle_yoast_term_redirect_slug_change($create_redirect, $term_id, $term, $term_before) { $old_slug = $term_before->slug; $new_slug = $term->slug; if ($old_slug !== $new_slug) { $redirect_url = get_term_link($term_id, $term->taxonomy); wp_redirect($redirect_url); exit(); } return $create_redirect; } add_filter('Yoast\WP\SEO\term_redirect_slug_change', 'handle_yoast_term_redirect_slug_change', 10, 4); This is working pretty fine but when it comes to termRedirectSlug it won't function handle_yoast_post_redirect_slug_change( $create_redirect, $post_id, $post, $post_before ) { $old_slug = $post_before->post_name; $new_slug = $post->post_name; var_dump($old_slug, $new_slug); if ( $old_slug !== $new_slug ) { $redirect_url = get_permalink( $post_id ); var_dump($redirect_url); wp_redirect( $redirect_url ); exit(); } return $create_redirect; } add_filter( 'Yoast\WP\SEO\post_redirect_slug_change', 'handle_yoast_post_redirect_slug_change', 999, 4 );
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.