Hi @ldwd
Thanks for using <span style=”box-sizing: border-box; margin: 0px; padding: 0px;”>the Super Web Share plugin and for creating the topic. Unfortunately, we won’t support the query string added by custom code on a page if the og:url meta tag is present in</span> the source code.
For example, if the og:url meta tag is available on the source code of a page, then our plugin will pick the same for the URL, as some social sharing platforms use it to output the web preview while sharing. You can find out the code here. In case the og:URL is not there in the specific URL the same URL showing on the address bar will get shared.
Another main reason we check for the og:url meta tag is that some social media platforms add parameters to URLs when they are clicked. If the sharing plugin shares the parameter URL by default, then the analysis to count the clicks from social media will become inaccurate. In these cases, the og:url will be outputted without this parameter, and the URL will be a clean one without having any UTM parameters or tracking parameters. <span style=”box-sizing: border-box; margin: 0px; padding: 0px;”>If you don’t prefer to check the og:url, you can remove the if condition in the code here.</span>
Please don’t hesitate to contact us back if you have further concerns. We are happy to help.
Thread Starter
ldwd
(@ldwd)
@josevarghese Thanks for your explanation, that really helped me a lot!
I added the snippet below to my functions.php which removes the og:url from one specific page using a filter hook from Yoast SEO plugin:
// Remove Yoast og:url tag
add_filter( 'wpseo_opengraph_url', 'remove_yoast_meta_tag' );
function remove_yoast_meta_tag( $presenter) {
if ( is_page ( 'my_page_slug' ) ) {
return false;
}
return $presenter;
}
This results in the url from the address bar being used which contains the parameter as you pointed out.
Now this plugin is even more awesome 😀 Thank you!
Hi @ldwd,
It’s great to hear that the details we shared about the code helped you find a fix for your case! Again, thank you for your kind words about this small sharing plugin; we appreciate the support.
The next version will include more features, but as we’re a small team, the release may be slightly delayed as we continue to add improvements after initially locking the release. We sometimes miss working on the plugin due to regular workday jobs.
Thanks again for your patience and support! 😊