Title: url_to_postid support
Last modified: July 24, 2018

---

# url_to_postid support

 *  [Pratham](https://wordpress.org/support/users/pratham2003/)
 * (@pratham2003)
 * [8 years ago](https://wordpress.org/support/topic/url_to_postid-support/)
 * Hi,
 * url_to_postid doesn’t work for posts on which custom permalink is set.

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

 *  Plugin Author [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/)
 * (@sasiddiqui)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/url_to_postid-support/#post-10629593)
 * [@pratham2003](https://wordpress.org/support/users/pratham2003/) sorry but doesn’t
   get what was the issue you were pointing to.
 *  [radukong](https://wordpress.org/support/users/radukong/)
 * (@radukong)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/url_to_postid-support/#post-10668494)
 * Hi Sami,
    I have an issue with the url_to_postid function too. In wordpress the
   function get_item( $request ) from /wp-includes/class-wp-oembed-controller.php
   use the url_to_postid function. After I enabled the Custom Permalinks plugin 
   and set a custom permalink for a page the get_item function return 0 for that
   page because the url_to_postid does not work with the custom permalink.
 *  Plugin Author [Sami Ahmed Siddiqui](https://wordpress.org/support/users/sasiddiqui/)
 * (@sasiddiqui)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/url_to_postid-support/#post-10685979)
 * Hi [@radukong](https://wordpress.org/support/users/radukong/)
 * Thanks for sharing the details.
 * I’ll check and will fixed it out if the issue is really there and i am able fix
   do that 🙂
 * Thanks,
    Sami
 *  [jeffreychingnl](https://wordpress.org/support/users/jeffreychingnl/)
 * (@jeffreychingnl)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/url_to_postid-support/#post-10829746)
 * Confirming this. I have issues with the oembed links in the header becoming 404
   since they only work with the original permalink and not with the custom permalinks
   as they are considered redirects. Not sure if this is even possible to fix from
   your end.
 *     ```
       <link rel="alternate" type="application/json+oembed" href="https://website.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwebsite.com/new-slug" />
       <link rel="alternate" type="text/xml+oembed" href="https://website.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwebsite.com/new-slug&format=xml" />
       ```
   
 * The above will not work but the use with the old names does.
 *     ```
       <link rel="alternate" type="application/json+oembed" href="https://website.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwebsite.com/old-slug" />
       <link rel="alternate" type="text/xml+oembed" href="https://website.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwebsite.com/old-slug&format=xml" />
       ```
   

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

The topic ‘url_to_postid support’ is closed to new replies.

 * ![](https://ps.w.org/custom-permalinks/assets/icon.svg?rev=1785367)
 * [Custom Permalinks](https://wordpress.org/plugins/custom-permalinks/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-permalinks/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-permalinks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-permalinks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-permalinks/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [jeffreychingnl](https://wordpress.org/support/users/jeffreychingnl/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/url_to_postid-support/#post-10829746)
 * Status: not resolved