Hello,
You’re very much welcome! You may let us know how that goes.
In the meantime, please do not hesitate to let us know if you need our assistance with anything else.
Thank you.
Hi, I have already spoken with the Wasabi theme support, and they have told me the following:
_______________
“Hi Alfonso.
Thanks for all the information, it has allowed me to detect it quite quickly.
The problem is that Rank Math uses that field but only supports as input value the Twitter username (for example, “marc_ortola”) and Wasabi only supports the full URL (for example, “https://twitter.com/marc_ortola?lang=es”).
The code you show is generated by Rank Math, Wasabi only adds the sameAs in the entries/pages, but not in the author page. What Rank Math does is to get the value set in the Profile (it expects a username, not a URL) and add the prefix “https://twitter.com/” to make it “https://twitter.com/” + “username”.
Right now it would be impossible to change Wasabi’s functionality to accept username and not URL, as it might break other client sites, so I can only think of disabling Wasabi Author’s structured data markup and changing the value set in the profile to “username”, not URL.
Rank Math could easily fix it by not adding the prefix “https://twitter.com/” if it detects that the configured value already starts with “https://twitter.com/”.
____
Would there be any possibility for you to implement this last thing Wasabi support tells me about, please?
I would greatly appreciate it.
Hi, I wanted to know if you had received my last message, as I really need to solve this problem with your plugin.
Hello,
We have forwarded this to the devs to check further and will get back to you soon with an update.
We really appreciate your patience in the meantime.
Thank you.
Oh, okay! Perfect!
I really appreciate it!
Thanks
Hello,
We have received updates from our development team and unfortunately, we can’t add a compatibility code to our plugin as it will be difficult for us to maintain it and this may also cause issues with other users as well.
However, we have come up with a workaround to address your issue. Please use this filter code for your website:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
foreach ( $data as $key => $items ) {
if ( ! isset( $items['sameAs'] ) ) {
continue;
}
foreach ( $items['sameAs'] as $sameAsKey => $url ) {
if ( substr_count( $url, 'https://twitter.com/' ) !== 2 ) {
continue;
}
$data[ $key ][ 'sameAs'][ $sameAsKey ] = preg_replace('/(https:\/\/twitter.com\/)/', '', $url, 1 );
}
}
return $data;
}, 99, 2);
You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.
Thank you very much! I have managed to solve the problem with the code you have provided me.
You guys are the best!
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.