Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 -
- 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 -

Supporter timezone: Asia/Kathmandu (GMT+05:45)

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by Shekhar Bhandari 2 days, 4 hours ago.

Assisted by: Shekhar Bhandari.

Author Posts
February 4, 2025 at 8:53 am

julianS-28

Background of the issue:
I am trying to ensure that the Yoast Author Schema URLs on our author pages always display the current domain for the DE website. We have many author pages, and I have a scrape that shows the Yoast author page URLs via the Schema markup: hidden link.

Symptoms:
The Yoast Author Schema links are displayed with different URLs on the DE version, sometimes showing .DE, .AT, or .NL domains.

Questions:
Can you help me to display the URLs always in the current domain?

February 4, 2025 at 9:49 am
February 5, 2025 at 4:33 am #16668989

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I have escalated this issue to our 2nd tier supporter, I will update you further as soon as I will receive any feedback from them.

Thanks

February 7, 2025 at 9:10 am #16678370

julianS-28

Hi, any news on this?

February 7, 2025 at 9:34 am #16678500

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

This is still on our 2nd tier queue, I will update you as soon as I will receive any further feedbacks.

Thanks

February 17, 2025 at 11:52 am #16713859

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Our 2nd tier suggested the following workaround, so can you try to add the following in theme functions.php file and see if it helps.

function modify_wpseo_schema_graph( $data ) {
	if ( empty( $data ) || ! is_array( $data ) ) {
		return $data;
	}

	foreach ( $data as &$schema_piece ) {
		// Check if the schema type is ProfilePage
		//if ( isset( $schema_piece['@type'] ) && $schema_piece['@type'] === 'ProfilePage' ) {
		// Update the URL
		if ( isset( $schema_piece['url'] ) ) {
			$schema_piece['url'] = apply_filters( 'wpml_permalink', $schema_piece['url'] );
		}
		if ( isset( $schema_piece["@id"] ) ) {
			$schema_piece["@id"] = apply_filters( 'wpml_permalink', $schema_piece["@id"] );
		}
		if ( isset( $schema_piece["primaryImageOfPage"]["@id"] ) ) {
			$schema_piece["primaryImageOfPage"]["@id"] = apply_filters( 'wpml_permalink', $schema_piece["primaryImageOfPage"]["@id"] );
		}
		if ( isset( $schema_piece["image"]["@id"] ) ) {
			$schema_piece["image"]["@id"] = apply_filters( 'wpml_permalink',$schema_piece["image"]["@id"] );
		}
		if ( isset( $schema_piece["breadcrumb"]["@id"] ) ) {
			$schema_piece["breadcrumb"]["@id"] = apply_filters( 'wpml_permalink', $schema_piece["breadcrumb"]["@id"] );
		}
		if ( isset( $schema_piece["potentialAction"][0]["target"][0] ) ) {
			$schema_piece["potentialAction"][0]["target"][0] = apply_filters( 'wpml_permalink', $schema_piece["potentialAction"][0]["target"][0] );
		}
		if ( isset( $schema_piece["mainEntityOfPage"]["@id"] ) ) {
			$schema_piece["mainEntityOfPage"]["@id"] = apply_filters( 'wpml_permalink', $schema_piece["mainEntityOfPage"]["@id"] );
		}
		//	}
	}

	return $data;
}
add_filter( 'wpseo_schema_graph', 'modify_wpseo_schema_graph', 10, 1 );

Look forward to your reply.

Thanks