Archived topic
Is there any way to access "elements" with WP rest API?
5 replies · Started by gary on March 30, 2023
Hi there,
I am looking for a way to change the elements in generatepress through the WP rest api, is there any way?
Hi there,
Elements are a post type like pages or posts, so you can access them by querying the gp_elements post type.
I'm not sure of everything core allows you to do with posts and the API, but anything you can do with posts you should be able to do with Elements.
Let us know if you need more info :)
Hi there, thanks for the answer.
Where do I exactly query gp_elements? I'm quite good with WP rest API but can't find any good explanation on how to add stuff to gp_elements
assuming its :{domain_name}/wp-json/wp/v2/gp_elements/{pageid} ?
I'm trying to add stuff to field "content" but keep getting 200 repsonse and nothing is changing
Got it working! The right field was "rendered"
Glad you got it sorted! :)