• Resolved vectormapper

    (@vectormapper)


    Problem with AMP plugin version 2.4.2

    Hello there))) This plugin from https://amp-wp.org/ – create the self-reference canonical URL – such as THIS:

    <link rel="canonical" >

    But it must point to the CORRECT (classic) canonical page. Such as:

    <link rel="canonical" >

    ALSO: In code All CANONICAL PAGES i see this tag: All correctly

    <link rel="amphtml" >  

    For this reason, only AMP pages are indexed in the Google index, and ordinary site pages are perceived as “doubles” – informational garbage. How can I solve this problem?

    • This topic was modified 1 year, 2 months ago by vectormapper.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter vectormapper

    (@vectormapper)

    In this plugin file [class-amp-post-meta-box.php] i found this code in line 192:

    wp_add_inline_script(
    			self::ASSETS_HANDLE,
    			sprintf(
    				'ampPostMetaBox.boot( %s );',
    				wp_json_encode(
    					[
    						'previewLink'     => esc_url_raw( amp_add_paired_endpoint( get_preview_post_link( $post ) ) ),
    						'canonical'       => amp_is_canonical(),
    						'enabled'         => empty( $support_errors ),
    						'canSupport'      => 0 === count( array_diff( $support_errors, [ 'post-status-disabled' ] ) ),
    						'statusInputName' => self::STATUS_INPUT_NAME,
    						'l10n'            => [
    							'ampPreviewBtnLabel' => __( 'Preview changes in AMP (opens in new window)', 'amp' ),

    So, this code fragment show, that AMP as CANONICAL is FORCED.
    What need to change in code?


    Thread Starter vectormapper

    (@vectormapper)

    UUID ampwp-61464a46-0b0f-5eff-ae91-70f8133c36d4

    Thread Starter vectormapper

    (@vectormapper)

    In other, similat topic – i see this resolve (for another plugin, AMP-for-WP):

    add_filter(‘ampforwp_the_content_last_filter’,’jc_fix_ampforwp_canonical’,50);
    function jc_fix_ampforwp_canonical($content){
    $content = preg_replace(“/<link rel=\”canonical\” href=\”([^>]*)\/amp\/\” \/>/”, “<link rel=\”canonical\” href=\”$1/\” />”, $content);
    return $content;
    }

    • This reply was modified 1 year, 2 months ago by vectormapper.
    Plugin Support Milind More

    (@milindmore22)

    Hello @vectormapper

    Thank you for contacting us, As we checked your details we found out that WP Meta SEO plugin is responsible for adding the wrong canonical link.

    The WP Meta SEO adds the current URL (AMP URL) on AMP pages as the canonical link, the AMP plugin however adds the correct canonical URL and doesn’t need correction

    We will recommend contacting the WP Meta SEO plugin or Please use an alternative plugin from the list of AMP compatible plugins

    We hope this helps!

    Thread Starter vectormapper

    (@vectormapper)

    Great thanks, Senor Milind More)))

    Plugin Support Milind More

    (@milindmore22)

    @vectormapper Glad our suggestion is helpful, I’ll mark this as resolved Open a new support topic if you face further issues, also feel free to leave a plugin review, we would love to hear your feedback.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Self-reference AMP page as canonical = PROBLEM’ is closed to new replies.