Title: INVALID_DOCUMENT Error when using WordPress Post Embeds
Last modified: May 18, 2022

---

# INVALID_DOCUMENT Error when using WordPress Post Embeds

 *  Resolved [ashtee](https://wordpress.org/support/users/ictinus/)
 * (@ictinus)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/invalid_document-error-when-using-wordpress-post-embeds/)
 * It seems there is an INVALID_DOCUMENT error that prevents the post from being
   published or updated when there is a WordPress Post being linked/embedded.
 * Here is the error:
    `There has been an error with the Apple News API: INVALID_DOCUMENT-"
   URL" was "https://ashleydev.com/title-of-the-article-to-be-embeddedk/embed/#?
   secret=n3IxPCSAEH#?secret=F2EySfsGEl" should be valid URL with one of ["http","
   https","#","webcal","stocks","action","music","musics","tel","mailto"] scheme(
   s) (keyPath components->1->components->7->components->1->additions->0->URL)`
 * I’ve exported the json file and looking at the output. It looks like the plugin
   is grabbing the embed url created by WordPress, instead of the actual url of 
   the post it should be linking to.
 * Here is the json snippet:
 *     ```
       {
                 "layout": "embed-generic-layout",
                 "role": "container",
                 "components": [
                   {
                     "role": "heading2",
                     "text": "“Title of the article to be embedded—",
                     "format": "html"
                   },
                   {
                     "role": "body",
                     "text": "<a href=\"https://ashleydev.com/title-of-the-article-to-be-embedded/embed/#?secret=n3IxPCSAEH#?secret=F2EySfsGEl\">View on the original site.</a>",
                     "format": "html",
                     "textStyle": {
                       "fontSize": 14
                     }
                   }
                 ]
               },
       ```
   
 * Is there a fix for this?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Kevin Fodness](https://wordpress.org/support/users/kevinfodness/)
 * (@kevinfodness)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/invalid_document-error-when-using-wordpress-post-embeds/#post-16072866)
 * We’re tracking this as a bug here: [https://github.com/alleyinteractive/apple-news/issues/922](https://github.com/alleyinteractive/apple-news/issues/922)
 * Unfortunately, there isn’t a fix available yet. I’m going to close this issue
   in favor of tracking progress in GitHub. You are welcome to subscribe to the 
   issue on GitHub to receive updates there.

Viewing 1 replies (of 1 total)

The topic ‘INVALID_DOCUMENT Error when using WordPress Post Embeds’ is closed to
new replies.

 * ![](https://ps.w.org/publish-to-apple-news/assets/icon-256x256.png?rev=3017580)
 * [Publish To Apple News](https://wordpress.org/plugins/publish-to-apple-news/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/publish-to-apple-news/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/publish-to-apple-news/)
 * [Active Topics](https://wordpress.org/support/plugin/publish-to-apple-news/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/publish-to-apple-news/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/publish-to-apple-news/reviews/)

## Tags

 * [Apple News](https://wordpress.org/support/topic-tag/apple-news/)
 * [embed](https://wordpress.org/support/topic-tag/embed/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kevin Fodness](https://wordpress.org/support/users/kevinfodness/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/invalid_document-error-when-using-wordpress-post-embeds/#post-16072866)
 * Status: resolved