Hello @lamayas,
All the metatags added by the Rank Math plugin are correctly written. The notices you get in the W3C validator are only info, and it also states that it has no effect and interacts badly with unquoted attribute values. We never use unquoted attribute values in the metatags, so this shouldn’t be a problem. You can ignore those info messages.
However, as per your request, we tried to build a filter/hook to remove the trailing slash, but we noticed that this might create complexity upon application.
Hence, the easiest way would be to edit the plugin’s core file, even though that’s not the recommended way.
Please head over to /wp-content/plugins/seo-by-rank-math/includes/frontend/class-head.php:
Edit line 200 and replace it with the following one:
echo '<meta name="robots" content="', esc_attr( $robotsstr ), '">', "\n";
Edit line 217 and replace it with the following one:
echo '<link rel="canonical" href="' . esc_url( $canonical, null, 'other' ) . '" >' . "\n";
After that, head over to /wp-content/plugins/seo-by-rank-math/includes/opengraph/class-opengraph.php:
Edit line 182 and replace it with the following one:
printf( '<meta %1$s="%2$s "content="%3$s">' . "\n", $tag, esc_attr( $property ), $escaped_value );
Please stay advised that all these changes will revert once you update the plugin to the latest version.
If you don’t want to use the OpenGraph tags generated by Rank Math, you simply remove and add them from any other sources:
https://rankmath.com/kb/filters-hooks-api-developer/#remove-opengraph-tags
Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
Thank you.