oembed 404 error

  • hi,There is a bug in rankmath, the oembed link of the website cannot get data.

    • This topic was modified 6 days, 12 hours ago by sven.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    To fix the oembed issue, please add following code to your theme’s functions.php file:

    
    add_filter( 'oembed_request_post_id', function( $post_id, $url ){
    	if ( $post_id ) {
    		return $post_id;
    	}
    	$parsed_url = wp_parse_url( $url ); // Parse URL
    	$slug = substr( $parsed_url['path'], 1 );
    	$post = get_page_by_path( $slug, OBJECT, 'product' );
    	if ( ! is_wp_error( $post ) && ! empty( $post ) ) {
    		$post_id = $post->ID;
    	}
    	return $post_id;
    }, 10, 2);
    

    That should resolve the issue. If it doesn’t, please let us know.

    Thank you.

    Hello, I’ve been checking out SEO plugins for our new site and have seen that Rank Math comes highly recommended. During my testing, as stated in this post, I also noticed that with Rank Math page shares to LinkedIn don’t properly pick up the open graph data like I’ve observed on another plugin I’m testing. Since LinkedIn is our highest priority for social sharing, do you have an estimate of when your update for addressing this will be available? I read in another post that you’re working on one. I’m liking your plugin for SEO the best for all the other features, but I’d rather have one that works out of the box without adding fixes with code. Thank you!

    Hello Lori,

    All the code fixes we provide here in the forums are usually added in updates few weeks later.

    We provide those quick fixes to help our users have a quick solution and a good experience with us and once we completely integrate the solution in the plugin, it is delivered for everyone, so about it, you don’t have to worry, if you don’t want to add custom codes, you should feel safe, our team is really active developing the plugin and fixes are quickly added in the plugin.

    Looking forward to help you.

    Hello Alberto, Thanks for the quick reply!

    I have seen a couple of posts here that are at least several weeks old with this fix, and even one a few months old already. So what I’m hoping to find out is how much longer you estimate it’ll be before the update with this fix is released- a week/month/year?

    Also, if someone adds the above code as a temporary fix, what happens when you update the plugin? Does the code need to then be removed from the function php file? (I’m not a programmer so don’t like to mess around with those files.)

    I’d like to use Rank Math but need to know how long I’ll have to wait to get the oembed issue addressed.

    Thanks!

    Hello,

    I can’t tell you the amount of time to wait since it depends of the issues we are finding (maybe we find a really big bug and we have to spend all our time fixing it). We release at least one update per week so it will take at least 1 week.

    About what happens once the plugin is updated, you should remove the code if the issue is already fixed in the plugin, to avoid conflicts. But if it is your case and you don’t know how to do it, we are always here to help you.

    Looking forward to help you.

    Ok, thanks for the reply. I will check back to see if your next update includes this fix before I decide on plugins.

    On a separate but related topic: Is there a definitive answer on the ideal image size for fb, etc. posts, or does it not really matter? In your support docs it lists both 1200×630 and 1200×628 as best – on the same screenshot! I’ve seen both sizes listed on other sites as well, not just yours. Does anybody know the final answer to this big mystery? Does it matter anyway? 🙂

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this ticket.