最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to post content to Elementor Pages using Wordpress API - Stack Overflow

programmeradmin1浏览0评论

With the below mentioned Wordpress API Call, the content gets posted to the page ID, but the changes doesn't appear on the Elementor Page.

Headers:
  - Authorization: Bearer YOUR_WP_API_KEY
Body:
  {
    "title": "New Title",
    "content": "New Content",
    "status": "publish"
  }

Postmaster API response shows that the content has been updated,

Any help/suggestion is highly appreciated.

With the below mentioned Wordpress API Call, the content gets posted to the page ID, but the changes doesn't appear on the Elementor Page.

Headers:
  - Authorization: Bearer YOUR_WP_API_KEY
Body:
  {
    "title": "New Title",
    "content": "New Content",
    "status": "publish"
  }

Postmaster API response shows that the content has been updated,

Any help/suggestion is highly appreciated.

Share Improve this question edited Apr 1 at 6:22 VLAZ 29.1k9 gold badges63 silver badges84 bronze badges asked Mar 30 at 20:57 Mahesh BabuMahesh Babu 3052 silver badges9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You can use two different API endpoints. One for posts, and one for pages. Make sure you're using the right endpoint. So, if you use the right endpoint. There is a second thing to consider. Elementor is storing its editor data inside its own meta key _elementor_data we need to empty that. And then you will see your new content appear.

For posts use [POST REQUEST]:
[your-domain.name]/wp-json/wp/v2/posts/{postID}

And for pages you can use [POST REQUEST]:
[your-domain.name]/wp-json/wp/v2/pages/{postID}

You don't have to specify your title and status, you can just post the content and the elementor meta key inside your JSON:

{
    "content": "My new content yes!",
    "meta": {
        "_elementor_data": ""
    }
}

Also, for everyone:
If you create a bearer token for your WordPress user, make sure to use your username as the username for your bearer token, not the 'App name' you gave while creating the bearer token. This can save you some headaches.

发布评论

评论列表(0)

  1. 暂无评论