How to Copy an Elementor Page from One Site to Another
Recently, I’ve been doing a lot of work with Elementor, specifically, developing integrations with my plugins, mostly because I receive many requests from my customers. Personally, I prefer using the Block Editor on my projects, but Elementor is the most popular page builder after all. Since it is used on a huge number of WordPress websites, my goal is to make my plugins work flawlessly with it.
In this step-by-step guide, I’d like to show you two ways of copying a page created with Elementor to another site:
- Using a crossposting plugin (we will use the Simple WP Crossposting plugin),
- Programmatically (in this method, we will do it with the WordPress REST API).
There is also a third, partial way, which comes down to exporting and importing your Elementor templates. It doesn’t require any knowledge, and you can learn to do it either intuitively or just by watching a random video on YouTube.
Now, let’s jump straight into our two methods.
Copy an Elementor Page to Another Site Using a Plugin
Before we dive into the coding stuff and a detailed explanation of how things work under the hood, I’d like to remind you that you can easily copy pages created with Elementor from one site to another using my Simple WP Crossposting plugin.
Please, check the screenshot below to get an idea of how it is going to work:

Here are a few more details about how it is going to work:
- When you first create a page, you need to exit from the Elementor editor to the WordPress editor (it could be either the Classic or Block editor – it doesn’t matter), then select target sites from the “Publish on” metabox and hit the “Publish” (or “Update”) button.
- After that, you can feel free to make changes and update the page directly in Elementor – all its changes will be synced to selected target sites automatically.
The plugin works great with both a free version of Elementor and Elementor PRO.
Make sure your sites are using the same Elementor layout
It doesn’t matter which way you choose to copy an Elementor page to another site – in any case, you will need to make sure that all the sites are using the same Elementor layout.
It is a really big deal because if they don’t, your Elementor pages will be copied from one site to another, but they will be empty, without any widgets at all.
So, let’s go to Elementor > Editor > Settings > Features and make sure the “Container” option is either activated or deactivated across all the sites you’re about to copy a page between.

Copy an Elementor Page to Another Site Programmatically
Is using the plugin not an option for you? No worries at all. Let me show you a programmatic way of copying an Elementor page from one site to another.
It would probably be a little bit more complicated, but I am sure we can figure it out.
How Elementor stores its content
Before we dive into the coding itself, we need to get a clear picture of how Elementor structures its content (Elementor widgets and their settings) and how it is stored in the database.
For example, if you take a look at the post_content value in the database, we will notice that it is a mess. However, what I like about Elementor is that it does not use an excessive amount of WordPress shortcodes like other page builder plugins do.
To get a clear understanding of how it works, let’s take a quick look at the table below:
| The Block Editor | Elementor |
|---|---|
The blocks and their configuration are stored in post_content, in wp_posts table. | Elementor widgets and their settings are stored in a single custom field _elementor_data which is obviously in the wp_postmeta table. |
The data is stored in the _elementor_data field as a JSON string, it may look something like this:

json_decode() function to show you the value of the _elementor_data custom field in a structured way as an object.The pages created with Elementor have some other custom fields, but _elementor_data is the main one; without it, nothing is going to work.
Registering custom fields (metadata)
So, when we want to copy an Elementor page from one site to another, the main thing we should worry about is copying the _elementor_data custom field.
Since we’re copying pages to another site with the WordPress REST API, we have to register custom fields, specifically the _elementor_data one on the other site. We can do it with the help of a register_meta() function that can be used inside the init hook.
If you’re using the latest version of Elementor, this step is now optional.
add_action( 'init', function() {
register_meta(
'post',
'_elementor_data',
array(
'type' => 'string',
'show_in_rest' => true,
'auth_callback' => '__return_true',
)
);
} );A couple of things to remember here:
- This code snippet should be used on all sites you’re about to copy pages created with Elementor to. How to use it – you can read this guide.
- Luckily, Elementor stores its data as a JSON string, so we don’t need to worry about the custom field schema; just pass its
typeparameter with thestringvalue, and here we go. - Since this custom field is a protected one (it starts with the
_symbol), theauth_callbackis required.
This was kind of a preparation step, and we’re done with it.
Copying an Elementor page from one site to another using a PHP function and the save_post hook
It seems like we’re done with the whole bunch of preparation steps, and we’re ready to copy our Elementor page to another site. As I already mentioned before, we’re going to use the WordPress REST API for that.
Below, you can find a custom PHP function that you can use on the original site. You need:
- To pass a page ID, you’re about to copy as a function argument,
- To provide “Site 2” authentication data on lines 26-28.
By the way, if you don’t know where to get an application password for the REST API request, please check the step-by-step explanation here.
/*
* @snippet Allows you to copy an Elementor from one site to another
* @author Misha Rudrastyh
*/
function rudr_copy_elementor_page_to_another_site( $page_id ) {
$page = get_post( $page_id );
$elementor_data = get_post_meta( $page->ID, '_elementor_data', true );
$page_data = array(
'title' => $page->post_title,
'status' => 'draft', // $page->post_status,
'slug' => $page->post_name,
'menu_order' => (int) $page->menu_order,
// we still need to copy an Elementor page content
'content' => $page->post_content,
'meta' => array(
// surely, the Elementor page most likely will have other meta data
// but this is the only one required
'_elementor_data' => $elementor_data,
),
);
// we need this data to connect to REST API
$login = '';
$pwd = '';
$url = '';
$response = wp_remote_post(
"{$url}/wp-json/wp/v2/pages",
array(
'headers' => array(
'Authorization' => 'Basic ' . base64_encode( "$login:$pwd" ),
'Content-Type' => 'application/json; charset=utf-8',
),
'body' => json_encode( $page_data )
)
);
if( 'Created' === wp_remote_retrieve_response_message( $response ) ) {
// Everything is great!
return true;
} else {
return false;
}
}What else would I like you to know about this code?
- It is super-simplified. First of all, I skipped the whole custom fields part and just copied the
_elementor_datacustom field, but I am pretty sure that your pages may have other custom field data as well. - Your Elementor pages may include some Elementor templates. If you don’t know, Elementor templates are just CPT, connected to your target page by ID, which means that we have to either copy templates to another site as well or replace the link to a template with the template itself 🙃 I know, it seems kind of complicated, but all you need to do is loop through the widgets in the
_elementor_datacustom fields. - You can use it not only for pages but also for posts and pretty much for any custom post type; you just need to use an appropriate REST API endpoint instead of
wp/v2/pages.
If you want the pages to be copied automatically, you can connect this function to the save_post action hook (or only for pages – save_post_page).
// if you want to copy Elementor pages to another site automatically
add_action( 'save_post', 'rudr_copy_elementor_page_to_another_site', 25 );If this whole part seems complicated for you, you can always use my plugin instead. Please let me know your thoughts in the comments section below.
Misha Rudrastyh
Hey guys and welcome to my website. For more than 15 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me