Schedule WordPress Exports Using Cron Jobs

Schedule WordPress Exports Using Cron Jobs

To run a WordPress export on a schedule, create two cron jobs on your server. Set one cron job to run every 2 minutes and execute the processing URL from WP All Export. Then, set up another cron job that executes the trigger URL and runs however often you want the export to run.

Manual Scheduling vs Automatic Scheduling

WP All Export offers two ways to schedule or automate exports. The first option is to manually create the cron jobs in the server. The second option is to use our paid Automatic Scheduling Service, which is integrated within WP All Export and doesn't require any setup. Learn more about Automatic Scheduling.

This guide focuses on Manual Scheduling.

Manual Scheduling Uses Cron Jobs

Cron jobs are like reminders for your web server. When you create a cron job, you are basically telling your server that you want to do a specific thing over and over at specific times.

These cron jobs consist of two things: a time and a command. The way they handle time is a little weird, but there are tools like https://crontab.guru/ that make it easy to understand. When the cron job is triggered, the web server will execute the command you provided. In this case, you'll tell the server to open a URL that will trigger your export to run.

To set up an export with Manual Scheduling, WP All Export actually uses two cron jobs to make sure they run on time and finish the export.

Trigger URLs and Processing URLs

Each scheduled export requires two cron jobs. The first one uses the trigger URL, which will fire whenever you want the export to run. The second uses the processing URL, which will fire every two minutes. Web servers generally don't like processes running in the background for a long time, and will kill them after a few minutes. The processing URL goes through and checks to make sure that your export has completed running. If it hasn't, it will start it up again.

To get your trigger URL and processing, navigate to the Manage Exports page, then click on Scheduling Options:

Once there, select the Manual Scheduling option. There you will find the trigger URL and processing URL. There's also a File URL, and a Bundle URL, used to retrieve the latest export files:

The trigger URL is structured like this: https://[YOUR-WEBSITE].com/wp-load.php?export_key=[YOUR_SECRET_KEY]&export_id=[YOUR_EXPORT_ID]&action=trigger

The processing URL is structured like this:https://[YOUR-WEBSITE].com/wp-load.php?export_key=[YOUR_SECRET_KEY]&export_id=[YOUR_EXPORT_ID]&action=processing

Your secret key can be accessed and reset from All Export › Settings.

The trigger cron should be set to run however often you want your export to run.

The processing cron should be set to run every two minutes.

Example Cron Jobs

You should be able to create your cron job in your web hosting control panel. To create a cron job that hits the cron URLs, commonly the wget command is used.

wget -q -O - /dev/null "https://example.com/wp-load.php?export_key=ph2Pyi_dMN&export_id=1&action=trigger"
wget -q -O - /dev/null "https://example.com/wp-load.php?export_key=ph2Pyi_dMN&export_id=1&action=processing"

Alternatively, you can use cURL.

curl -s "https://example.com/wp-load.php?export_key=ph2Pyi_dMN&export_id=1&action=trigger" > /dev/null
curl -s "https://example.com/wp-load.php?export_key=ph2Pyi_dMN&export_id=1&action=processing" > /dev/null

Please note that in both cases, the URLs need to be in quotes. Here's how these cron jobs would look in cPanel:

Get Help From Your Host

If you're not sure how to create these cron jobs manually, your web host support team will be able to set them up for you. Here's an e-mail template you can use:

Please set up two cron jobs.

CRON JOB 1
Fetch this URL every 24 hours:
https://[YOUR-WEBSITE.com]/wp-load.php?export_key=[YOUR_SECRET_KEY]&export_id=[YOUR_EXPORT_ID]&action=trigger

CRON JOB 2
https://[YOUR-WEBSITE.com]/wp-load.php?export_key=[YOUR_SECRET_KEY]&export_id=[YOUR_EXPORT_ID]&action=processing

If your web host doesn』t have a cron feature, you can use an external service such as EasyCron.

Call Cron URLs from the Command Line

You can also call the WP All Export cron URLs from the command line. This may be necessary if your site's configuration doesn't allow inbound calls to the regular cron URLs.

It'd look something like this:

/path/to/your/php-cgi /path/to/your/wordpress/install/wp-load.php export_key=[YOUR_EXPORT_KEY] export_id=[YOUR_EXPORT_ID] action=trigger
/path/to/your/php-cgi /path/to/your/wordpress/install/wp-load.php export_key=[YOUR_EXPORT_KEY] export_id=[YOUR_EXPORT_ID] action=processing

Yoast WordPress SEO

Yoast WordPress SEO

In this tutorial you』ll learn how to import posts into WordPress along with their settings for the Yoast WordPress SEO plugin. WP All Import makes it easy to import into almost any plugin or theme.

You can complete this import manually, as described below, or you can use the Yoast Add-On for WP All Import: https://wordpress.org/plugins/yoast-seo-settings-xml-csv-import/

The settings for Yoast are stored in Custom Fields attached to every post. Watch the video tutorial below to see how easy it is to import these settings:

Just like importing other Custom Fields, you can manually enter the field name into WP All Import or you can choose to have WP All Import auto detect all of the Custom Fields attached to the post type you』re importing to. Remember, in order for WP All Import to detect these Custom Fields there must be at least one post on your site using them.

Yoast uses thirteen different Custom Fields to store settings for your posts. If you don』t import a value to a Custom Field then Yoast WordPress SEO will simply assign your post the default for that field.

NameCustom FieldValuesFocus Keyword_yoast_wpseo_focuskwText stringSEO Title_yoast_wpseo_titleText stringMeta Description_yoast_wpseo_metadescText stringMeta Robots Index_yoast_wpseo_meta-robots-noindexBlank for default, 1 for noindex, or 2 for indexMeta Robots Follow_yoast_wpseo_meta-robots-nofollowBlank for follow, 1 for nofollowMeta Robots Advanced_yoast_wpseo_meta-robots-advBlank for default, none, noodp, noydir, noimageindex, noarchive, or nosnippetInclude in Sitemap_yoast_wpseo_sitemap-includeBlank for auto, always, or neverSitemap Priority_yoast_wpseo_sitemap-prioBlank for auto, 1 to .1Canonical URL_yoast_wpseo_canonicalCanonical URL of post301 Redirect_yoast_wpseo_redirectURL to redirect post toFacebook Title_yoast_wpseo_opengraph-titleText stringFacebook Description_yoast_wpseo_opengraph-descriptionText stringFacebook Image_yoast_wpseo_opengraph-imageURL to imageTwitter Title_yoast_wpseo_twitter-titleText stringTwitter Description_yoast_wpseo_twitter-descriptionText string

Here』s an example of how your import template might look while importing Yoast WordPress SEO settings:

Yoast Custom Fields

Importing SEO data for Taxonomies

Yoast stores taxonomy SEO data via the Options API, so the Term Meta section won』t work – instead, you』ll need to use our add-on for Yoast: https://wordpress.org/plugins/yoast-seo-settings-xml-csv-import/. In the import settings, you』ll still use the term meta section to decide which fields to update. Here are all of the available taxonomy fields:

NameCustom FieldValuesFocus Keywordwpseo_focuskwText stringSEO Titlewpseo_titleText stringMeta Descriptionwpseo_descText stringMeta Robots Indexwpseo_noindexBlank for default, 1 for noindex, or 2 for indexInclude in Sitemapwpseo_sitemap_includeBlank for auto, always, or neverCanonical URLwpseo_canonicalCanonical URL of postFacebook Titlewpseo_opengraph-titleText stringFacebook Descriptionwpseo_opengraph-descriptionText stringFacebook Imagewpseo_opengraph-imageURL to imageTwitter Titlewpseo_twitter-titleText stringTwitter Descriptionwpseo_twitter-descriptionText stringTwitter Imagewpseo_twitter-imageURL to image

Encoding & Character Sets

Encoding & Character Sets

XML Files Can Have Any Character Encoding

XML files can be saved with any character encoding. That character encoding should be defined at the top of the XML file, per XML standards on specifying the character encoding of an XML document.

If special characters in your XML file aren』t appearing correctly in the posts created by WP All Import, it means that the encoding specified in your XML file is probably incorrect – maybe your XML file is claiming to be a UTF-8 when it really is a Windows-1252, or similar.

If you're sure that your XML file is valid, it's not using UTF-8 encoding, and WP All Import is still rejecting it, try adding this code snippet inside your child theme's functions.php file (or in a plugin like Code Snippets):

add_filter( 'is_xml_preprocess_enabled', 'wpai_is_xml_preprocess_enabled', 10, 1 );
function wpai_is_xml_preprocess_enabled( $is_enabled ) {
return false;
}

CSV Files Must Be UTF-8 Or UTF-8 Compatible

Since there is no way to specify the character encoding for a CSV file, WP All Import just assumes all uploaded CSV files are UTF-8, which is the standard character encoding for the web.

This works the vast majority of the time, but if you are importing a CSV file with special characters (things like umlauts, non-Latin characters, etc.) and those special characters aren』t appearing correctly in the posts created by WP All Import, try opening your CSV file in a text editor using the correct encoding, and then re-save it using UTF-8.

On a Mac, our favorite way to do this is using Sublime Text 2.

Send Exported WordPress Data via Email using Zapier

Send Exported WordPress Data via Email using Zapier

Zapier can be used to send an export file via email. Connect Zapier to WP All Export and create the required trigger and action. The trigger would execute whenever a new export is found. The action would be sending the export file via email using Gmail.

Trigger: New Export File in WP All Export Pro

Learn more about connecting to Zapier and setting up the trigger here: https://www.wpallimport.com/documentation/external-app-integration/.

Action: Send Email in Gmail

Choose app & event

Once the trigger is configured and tested, Zapier will prompt to select an action.

Choose Gmail as the app and Send Email as the event, then click Continue.

Choose Account

Zapier will ask for the Gmail account to use. If there's no account connected, select + Connect a new account from the dropdown list and follow the steps.

Once the account is selected, click Continue.

Set up action

This section allows setting up the email that will be sent.

The following can be configured:

To: Who will this email be sent to? Multiple email addresses can be entered as a comma separated list.Cc: Who should be cc'd on this email? Multiple email addresses can be entered as a comma separated list.Bcc: Who should be bcc'd on this email? Multiple email addresses can be entered as a comma separated list.From: Select an email address or alias from your Gmail Account. Defaults to the primary email address.From Name: Used to define a different "From" name for the email. Reply To: Specify a single reply address other than your own.Subject: Email's subject or title.Body Type: Type of content found in the body, plain or HTML. Body: Body or content of the email.Signature: Include a default signature with the email? Will be placed at end of the message after a line break and another "--" line. Label/Mailbox: Used to define a label to sort the email.Attachments: The file to be attached. Select Export File from the dropdown list to attach the actual export file.

Click Continue to move onto the following step.

Test action

Once the email has been configured, Zapier will attempt to test the action. Select Skip Test to avoid this step.

Review all information about the email and click Test & Continue.

Once the test has been completed, click on Turn on Zap to enable the newly created zap.

Bulk Edit

Bulk Edit

You can quickly bulk edit posts using WP All Import and WP All Export along with your favorite spreadsheet program (Excel, Numbers, etc). The data is first exported with WP All Export. Then make your changes and upload it with WP All Import.

Step 1: Select What You Want to Export

You must first decide which post type or taxonomy you want to edit. You'll see all of the available options in the dropdown at the start of a new export.

Step 2: Decide Which Data to Edit

You'll see all of the data available to export on the right. Drag over the fields you need to edit and they'll be included in the export file. Certain fields are required depending on the post type being exported, you'll see a message if you're missing any of those.

Step 3: Confirm & Run Export

Run the export.

Step 4: Download Export File

Once the export completes you'll need to download the generated CSV file.

Step 5: Update the Exported Data

Using the program of your choice open the export file and make any updates necessary. Don't remove any columns or data will be missing after the import runs.

Step 6: Generate a New Import

Using the 'Import with WP All Import' button will start the creation of a new import. This option automatically configures the import settings for you. Your import will be created based on the fields you set when exporting.

Step 7: Upload the Updated File

Choose the option to 'Upload a file' and select the CSV you just modified. Your file will be uploaded and you'll be taken directly to Step 2 of the new import.

Step 8: Review the Data to Update

Here the data to be updated is already mapped to the appropriate import fields. You can take a look at what was mapped, or just continue to Step 4.

Step 9: Review the Data to Update

Here you can modify what data to update when the import runs. Usually, it shouldn't be changed.

Step 9: Confirm & Run Import

Now it's time to run your import.

Plugin & Theme Conflicts

Plugin & Theme Conflicts

Sometimes an issue can be hard to diagnose because it』s being caused by another plugin or your theme. Follow these steps to test for a plugin or theme conflict:

Deactivate all plugins other than WP All Import, WP All Export, and any WP All Import/Export Add-Ons you are using. If you』re importing data into WooCommerce, ACF, or something similar you should leave that plugin active.Switch to a default, unmodified, WordPress theme. If you』re using an add-on to import into a theme, you can leave the theme active.Run your import/export and check the results. If the problem no longer occurs then we know that one of the deactivated plugins or your theme is the cause of the problem.

If there is a conflict, then slowly begin reactivating your old theme and plugins and running the import/export. When the problem returns, whatever you just activated is the cause of the problem.

If you find that deactivating all other plugins and switching to a default theme does not fix the issue, then there』s no conflict. If this is the case, submit a support request and we』ll help you track down the cause of the problem.

Send WordPress Export File to Dropbox using Zapier

Send WordPress Export File to Dropbox using Zapier

Zapier can send the export file to Dropbox. Connect WP All Export to Zapier and create the required trigger and action. The trigger would execute when a new export is found. The action would be uploading the export file to Dropbox.

Trigger: New Export File in WP All Export Pro

Connect to Zapier and set up the trigger as explained here: https://www.wpallimport.com/documentation/external-app-integration/.

Action: Upload a File in Dropbox

Choose app & event

After the trigger is set up, Zapier will prompt for an app and action.

Select Dropbox as the app, and Upload File as the action event.

Choose account

In this step, Zapier connects to the Dropbox account where the export file will be uploaded.

If no account has been connected, add one using + Connect a new account from the dropdown list. Click Continue after the account is selected.

Set up action

Define how the Dropbox action will behave in this section:

The next fields can be configured:

Folder: Where the file should be saved.File: File to save. Select Export File to include the latest export file.Overwrite: If there's an existing file with the same name, should Zapier overwrite it? Defaults to No.Specify File Name: The original filename is kept unless a different name is specified here. The file extension is kept.Specify File Extension: If a different filename is specified, this field allows to define a different file extension.

Once configured, click Continue.

Test action

After the Dropbox action is configured, Zapier will attempt to test it. Click Skip Test to avoid this step, or click Test & Continue to proceed.

Enable this Zap by clicking on Turn on Zap.

How to Let Clients Run WordPress Exports

How to Let Clients Run WordPress Exports

Client Mode in WP All Export allows admins to provide access to a limited, secure interface for selected user roles. Users with access to Client Mode can run exports and download export files for the exports made available to them.

By default, exports are only available to admins and are only available to non-admins when specifically added to Client Mode by an admin.

Enable Client Mode for Specific Exports

Client Mode can be enabled in Manage Exports › Export Settings.

It can also be enabled in All Export › Manage Exports from the Bulk Actions pulldown.

Enable Access to Client Mode

Go to the WordPress admin panel, then select All Export › Settings.Scroll down to Client Mode and select role select roles with access.

Giving a role access to Client Mode affects all user accounts with that role. They will have access to a limited part of WP All Export and will be able to run and download all exports that have been added to Client Mode.

What Clients See

For testing purposes, you can create an account for yourself and grant access to it. When going into WP All Export as a non-admin, users see a list of exports that you have given them access to.

This is how the Manage Exports page looks using Client Mode.

Client Mode and Security

Client Mode was built with security in mind. Users cannot edit any settings related to exports. They can only access exports that admins specifically allow. With exports they have access to, they can run exports, download the data, and nothing else.

How To Export WooCommerce Reviews to CSV or XML

How To Export WooCommerce Reviews to CSV or XML

To export reviews go to WP All Export › New Export and select WooCommerce Reviews. Next, drag and drop the elements on the right to configure your CSV or XML export file. Then, run the export and download your custom file.

Drag and Drop to Export WooCommerce Reviews

The WooCommerce review data to export is under Available Data. This data is organized into four sections: Review Data, Author Info, Parent, and Other.

Review Data

The fields under Available Data › Review Data contain the most important information about the review:

ID: The review ID, a unique number assigned to all reviews by WordPress.Product ID: The post ID of the reviewed product.Content: The text of the review, written by the author.Rating: The number of stars awarded by the author, a numerical value between 1-5.Approved: Whether the review is approved or not, exports 1 for approved, 0 for unapproved.Verified: The review is verified if the review's author purchased the product, exports 1 for verified reviews, 0 for unverified.Date (Server Time or GMT): The date the review was published, in y-m-d format.

Author Info

Data associated with the author of the review is in Available Data › Author Info.

Author's NameAuthor's EmailAuthor's URLAuthor's IP: The internet protocol address of the author.Agent: Information on which browser the author was using.User ID: The ID of the user account which created the review, exports 0 for guest reviews.

If the review was created by a registered user, all of the author info is pulled from its user account. If the review was done by a guest user, the name and URL is entered manually by the user when submitting the review.

Parent

More information related to the reviewed product is in Available Data › Parent.

Reviews are always attached to a product, which is referred to as the parent product. Reviews can also be the child of another review.

Parent Product Slug: The slug of the reviewed product.Parent Product Title: The title of the reviewed product.Parent Product ID: The post ID of the reviewed product, it's the same as the Product ID under Review Data.Parent Review ID: If this review does not have a parent review, 0 is exported.Parent Review Date (Server Time or GMT): If this review does not have a parent review, nothing is exported.

Other

Other less used data, like Karma, is in Available Data › Other.

Run WordPress Import on a Schedule

Run WordPress Import on a Schedule

The Automatic Scheduling service allows you to set up imports with just a couple of clicks. Rather than setting up cron jobs on your server, you can set schedules directly within WP All Import. The Automatic Scheduling service will then contact your site at the scheduled time to run your imports, and check in to make sure they've completed correctly.

Automatic Scheduling vs Manual Scheduling

WP All Import offers two ways to schedule or automate imports. The first option is to manually create the cron jobs in the server. The second option is to use our paid Automatic Scheduling Service, which is integrated within WP All Import and doesn't require any setup.

This guide focuses on Automatic Scheduling.

Configure a Scheduled WordPress Import

To set up the Automatic Scheduling Service on an existing import, navigate to the Manage Imports page. Then, click on Scheduling Options › Automatic Scheduling:

The same Scheduling Options menu appears when creating a new import.

There you decide whether you'd like your import to run weekly or monthly. Then you select the days and times that you would like your import to run.

Sign Up for Automatic Scheduling

This service costs $9 USD per month, and allows for unlimited imports to run on an unlimited amount of sites. Subscribe to the Automatic Scheduling service.