Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
og:url value is not translated on author archive page with Yoast SEO and WPML SEO 2.1.0

Solution:
Our development team is aware of the issue and working on the solution. Meanwhile please follow this workaround.

#1 Make sure you have a complete backup of site files and database. (Just a good practice)
#2 Edit the file wp-content\plugins\wp-seo-multilingual\classes\Presentation\Hooks.php
#3 On line 170 replace

} elseif ( 'post-type-archive' === $objectType ) {
    $newLink = self::getPostTypeArchiveLink( $presentation->model->object_sub_type, $originalLink );
}

with

} elseif ( 'post-type-archive' === $objectType ) {
    $newLink = self::getPostTypeArchiveLink( $presentation->model->object_sub_type, $originalLink );
} else if ( 'user' === $objectType ) {
    $newLink = get_author_posts_url( $presentation->model->object_id );
}

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by tillS-2 1 year, 5 months ago.

Assisted by: Sumit.

Author Posts
June 15, 2023 at 9:30 pm #13835441

tillS-2

I have a translated author page for German and English. Now the Ahrefs site audit reports the issue, that the German page has a different og:url and canonical url. (see attached screenshot). How can I resolve this?

hidden link

CleanShot 2023-06-15 at 23.27.50@2x.png
June 16, 2023 at 8:24 am #13837413

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thank you for contacting the support forum.

As I can see you are using Yoast SEO plugin. Could you please confirm that these tags are coming from Yoast SEO by disabling the plugin for a while?

This is to be sure that these tags are not coming from any other plugin or theme to continue the debugging.

Thanks

June 16, 2023 at 11:16 am #13838863

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

I can replicate the issue with Yoast SEO plugin.
Could you please confirm if this workaround works for you?

#1 Make sure you have a complete backup of site files and database. (Just a good practice)
#2 Edit the file wp-content\plugins\wp-seo-multilingual\classes\Presentation\Hooks.php
#3 On line 170 replace

		} elseif ( 'post-type-archive' === $objectType ) {
			$newLink = self::getPostTypeArchiveLink( $presentation->model->object_sub_type, $originalLink );
		}

with

		} elseif ( 'post-type-archive' === $objectType ) {
			$newLink = self::getPostTypeArchiveLink( $presentation->model->object_sub_type, $originalLink );
		} else if ( 'user' === $objectType ) {
			$newLink = get_author_posts_url( $presentation->model->object_id );
		}

#4 Then check the page again if this is working now.

Thanks