Support » Plugin: Yoast SEO » amp_validated_url/ redirect issue

  • Resolved satheeshrajv

    (@satheeshrajv)


    I’m getting the below error after applying the below code.which is provided in the URL : https://github.com/Yoast/wordpress-seo/issues/11643#issuecomment-440246846

    Code:
    function skip_redirect_for_amp( $skip_redirect, $post_id, $post ) {
    if ( $post->post_type === ‘amp_validated_url’ ) {
    $skip_redirect = true;
    }

    return $skip_redirect;
    }

    add_filter( ‘wpseo_premium_post_redirect_slug_change’, ‘skip_redirect_for_amp’, 10, 3 );

    Error: [Sat Jun 01 04:25:45.229318 2019] [php7:error] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function skip_redirect_for_amp(), 1 passed in /var/www/html/wp-includes/class-wp-hook.php on line 123 and exactly 3 expected in /var/www/html/wp-content/themes/Newspaper/functions.php:2\nStack trace:\n#0

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Pcosta88

    (@pcosta88)

    Hi,

    We would like some more information.

    1. Can you confirm you are using the most recent Yoast SEO, v11.5? If you update, does the issue resolve?

    2. Are all your non-Yoast plugins and themes also updated?

    3. What AMP plugin are you using? Is it this one: https://wordpress.org/plugins/amp/?

    4. How is the redirect being created? Are you saving a post or page and a redirect is showing? OR does it only happen when you publish a new post or a page?

    5. Are you using the Yoast SEO free or Premium plugin?

    Hi,
    Please find my response inline.

    1. Can you confirm you are using the most recent Yoast SEO, v11.5? If you update, does the issue resolve?
    Ans: I’m using premium Version 5.2 and it is not updating.

    2. Are all your non-Yoast plugins and themes also updated?
    Ans: Yes, all other plugins are updated.

    3. What AMP plugin are you using? Is it this one:
    Ans: Yes

    4. How is the redirect being created? Are you saving a post or page and a redirect is showing? OR does it only happen when you publish a new post or a page?
    Ans: When publishing a new post

    5. Are you using the Yoast SEO free or Premium plugin?
    Ans: Premium plugin. But I have not paid for this year. So is there any way to convert it to free plugin.

    Plugin Support Pcosta88

    (@pcosta88)

    Hi,

    We suggest disabling the older premium version and then switching to the new free one v11.6 (we released a new version today). Then seeing if the issue resolves.

    Note, that all your SEO data and settings will be moved into the free one, once you enable it. You are not expected to lose that data.

    However, you will no longer have access to the premium features like making redirects or multiple focus keywords. If you want access to those features we ask that you please purchase a new subscription to the plugin here https://yoast.com/wordpress/plugins/seo/

    Plugin Support Carl B

    (@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.

    So solution for others:

    Cause of the problem:
    Unknown

    Behavior:
    Some URL’s redirect to /amp_xxxxxxx/ url and land on the start page.

    Solution:
    Under SEO -> Redirect a faulty redirect is set. How this comes about is unclear to me so far. However, the path only has to be adjusted here.

    🙂 I hope to be able to help some.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘amp_validated_url/ redirect issue’ is closed to new replies.