WordPress Integration: Publish to WordPress & WooCommerce
Pricing
Pay per event
WordPress Integration: Publish to WordPress & WooCommerce
Two-way WordPress integration: publish any Apify actor's dataset as WordPress posts, pages, custom post types or WooCommerce products (with dedupe and safe re-runs), or export WordPress and WooCommerce content as a dataset for other actors.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Aimen Chenomi
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Features
Share
WordPress Integration: publish actor results to WordPress & WooCommerce
Connect any WordPress site to Apify, in both directions:
- Import: turn the results of any Apify actor (a scraper's dataset, a run, or JSON you paste) into WordPress posts, pages, custom post types or WooCommerce products. Re-runs update what changed and skip the rest, so nothing gets published twice.
- Export: read WordPress and WooCommerce content (posts, pages, custom post types, categories, tags, media, comments, users, products, orders, customers) into a clean dataset that you can download or feed into other actors. Scheduled runs can export only what changed since the last run.
You don't need a WordPress plugin. The actor uses the REST API built into WordPress.
Quick start (3 minutes)
1. Create an application password
In wp-admin go to Users → Profile → Application Passwords, type a name (e.g. "Apify") and click Add New Application Password. Copy the password it shows; this is not your login password. Application passwords need WordPress 5.6+ and an HTTPS site.
2. Test the connection (costs only the run start)
Enter the site URL, username and application password, keep What do you want to do? = Test connection, and click Start. You get a checklist:
Site: My Shop (https://shop.example)REST API: OKLogin: OK, logged in as "apify" (editor)Permissions: create posts yes, publish yes, pages yes, upload images yes, create categories yes, products NOWooCommerce: installed, access OKPost types: Posts (posts), Pages (pages), Products (product), Portfolio (portfolio)
If you also pick some data (a dataset ID, or paste a few items), the check previews how the first row would be published, and says which of your fields go where:
title ← productName "Walnut Shelf"content ← productDescription "<p>Wall shelf</p>"featuredImage ← thumbnailImage "https://…/shelf.jpg"unique key ← productUrl "https://shop.example/shelf"Not used from your data: listPrice, rating
3a. Publish another actor's results automatically
- Open the actor whose results you want to publish (e.g. a product scraper) → Integrations → Connect actor or task → choose WordPress Integration.
- Choose Publish data to WordPress, fill in the site and login, and pick Create as (blog post, page, WooCommerce product or custom post type).
- Every finished run of that actor is now published to your site. New items start as drafts; the run's status message links to them so you can review. Each result row has an Edit in WordPress link.
You can also run it by hand with a Dataset ID, an Actor run ID, or pasted items. Turn on Dry run first to see exactly what would be sent; no items are charged.
3b. Export your site
Choose Export WordPress content and what to export. Public posts, pages, terms, media and authors need no login; drafts, WooCommerce orders and customers do. Turn on Only what changed since the last run for scheduled exports.
Field mapping
Each WordPress field is filled from a template. If you leave the mapping empty, common field names are used: title/name, description/content, image/imageUrl/images, price, category, tags.
{"title": "{{title || name}}","content": "<p>{{description}}</p>{{specs | table}}<p><a href=\"{{url}}\">Source</a></p>","excerpt": "{{description | stripHtml | truncate:160}}","categories": "{{category}}","tags": "{{tags}}","featuredImage": "{{images.0}}","meta": { "source_url": "{{url}}", "price": "{{price | number}}" }}
| Syntax | Meaning |
|---|---|
{{field}}, {{a.b}}, {{images.0}}, {{images.url}} | value at a path; images.url collects url from every item of a list |
{{a || b || 'fallback'}} | first value that is not empty |
{{price | money}} | filters, applied left to right |
Filters: default:x, join:", ", split:",", first, last, number, int, money:2, multiply:1.2, string, trim, lower, upper, truncate:160, stripHtml, escape, nl2br, json, slugify, prepend:x, append:x, replace:from:to, date, bool, list (HTML list), table (HTML table of an object).
Special keys:
categories,tags: names. Missing terms are created.featuredImage: an image URL. The image is uploaded to the media library once and reused.meta: custom fields. They must be registered withshow_in_restto be saved.- For WooCommerce:
images(a list of URLs, which WooCommerce downloads itself),sku,regular_price,sale_price.
Any other key is sent to the REST API unchanged, e.g. menu_order, comment_status, stock_quantity, manage_stock. To turn off a default, map it to "".
HTML safety
Scraped data is untrusted. When the actor logs in as an administrator, WordPress saves HTML exactly as sent, without its usual filtering. So by default the actor removes anything that can run code in a visitor's browser:
<script>,<iframe>,<object>,<embed>,<svg>and<form>elementson…=event handlersjavascript:links and non-imagedata:links- CSS expressions
Formatting, links, images, tables and lists are kept. Turn on Allow unsafe HTML only for data you trust, e.g. when you need video embeds.
Sanitising also applies to custom fields. Even with it on, it is safer to give the actor an Editor account than an administrator, because WordPress then applies its own filtering as well.
Avoiding duplicates
Unique key (default {{url || id || sku}}, and the SKU for WooCommerce) identifies a row across runs.
- Posts: the actor remembers which WordPress ID each key became, in the state store (a named key-value store). It also gives new posts a slug ending in a hash of the key, so posts are found again even with a fresh state store.
- Products: products are found by their SKU.
- Re-runs:
- Changed rows are updated. Their status is kept, so posts you published by hand stay published.
- Identical rows are skipped and not charged.
- Items deleted in WordPress are created again.
- Lost answers: if WordPress saves an item but its answer is lost (a timeout or 502/504 on slow hosting), the actor looks the item up by slug or SKU before sending it again. So you won't get
my-postandmy-post-2. - Products without a SKU get a stable one (
apify-…, derived from the unique key), so they can always be found again. - Images are uploaded once per URL and remembered per site. If you delete a remembered image from the media library, it is uploaded again the next time it's needed.
- Dry run shows exactly what would be sent, without writing anything.
Example setups
Scraper → WooCommerce products (attach to the scraper in its Integrations tab):
{ "mode": "import", "siteUrl": "https://shop.example", "username": "apify", "applicationPassword": "xxxx xxxx xxxx xxxx","target": "wc_product", "postStatus": "draft", "uniqueKey": "{{url}}","fieldMapping": { "name": "{{title}}", "regular_price": "{{price | money}}", "sku": "{{sku || id}}", "images": "{{images}}", "categories": "{{breadcrumbs | last}}" } }
Articles → blog posts, published straight away, with the source linked:
{ "mode": "import", "siteUrl": "https://blog.example", "username": "apify", "applicationPassword": "…", "target": "post", "postStatus": "publish","fieldMapping": { "title": "{{title}}", "content": "{{text | nl2br}}<p>Source: <a href=\"{{url}}\">{{url}}</a></p>", "excerpt": "{{text | truncate:160}}", "tags": "{{keywords}}" } }
Nightly export of changed posts and orders (schedule this; each run exports only what changed since the last one):
{ "mode": "export", "siteUrl": "https://shop.example", "username": "apify", "applicationPassword": "…","resources": ["posts", "wc_orders"], "status": "any", "incremental": true }
Preview first: add "dryRun": true to any import to see exactly what would be sent; no items are charged.
Output
-
Import: one row per source row, with
action(created,updated,unchanged,skipped,failed, orwould-create/would-updatein a dry run),wpId,link,errorandwarnings. TheOUTPUTrecord holds the totals. -
Export: one row per item. Every row has
resource,id,title,url,status,dateandmodified(UTC), plus fields for its type:- posts:
contentHtml,contentText,excerpt,categories,tags,featuredImageUrl,author, … - products:
sku,price,stockStatus,images, … - orders:
total,lineItems,billing, …
Turn on Include raw API response to get everything.
- posts:
Speed
Each item takes one or two requests to your site, plus one upload per new image. Images are uploaded once and reused on later runs, and unchanged items cost a single check. How fast that goes depends on your host: by default the actor sends 3 requests at a time, which shared hosting handles comfortably. On fast or managed hosting (WP Engine, Kinsta, a VPS) raise Parallel requests to 8–10 for large imports. If you see timeouts or HTTP 503 errors, lower it to 1–2. Re-running is always safe.
Pricing
Pay per result, platform usage included:
| Event | Price |
|---|---|
| Item published (a post, page, custom post or product created or updated) | $1.99 per 1,000 (Store discounts: $1.89 Bronze, $1.79 Silver, $1.69 Gold) |
| Item exported (one row of exported content) | $0.49 per 1,000 ($0.47 Bronze, $0.44 Silver, $0.42 Gold) |
| Unchanged, skipped and failed items, dry-run previews | free |
| Run start | $0.00125 at the default 512 MB of memory ($0.00125 per GB, minimum one) |
So a Test connection run costs $0.00125, and publishing 1,000 new products costs $1.99 plus the run start. Scheduled re-runs of the same data cost almost nothing, because unchanged items are not charged.
You can cap the cost of a run with the maximum charge setting: the actor stops cleanly when it is reached, and the next run carries on where it stopped.
Troubleshooting
| Message | Fix |
|---|---|
| Could not find the WordPress REST API | Check the URL. A security plugin or the host may be blocking /wp-json/. Sites with plain permalinks are detected and supported (?rest_route=). |
| rejected the username or application password | Use the application password, not your login password, and the same user's login name. |
did not log in the user (rest_not_logged_in) | The host strips the Authorization header. Add SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 to .htaccess. |
| HTTP 403 / firewall page | Allow REST API requests in Wordfence, iThemes, Cloudflare or your host's WAF. |
| Shared hosting slow or 503 | Lower Parallel requests to 1–2. Transient errors are retried automatically. |
WooCommerce REST API keys only work over HTTPS. On plain-HTTP test sites, use the application password instead.
Legal
This actor talks to the WordPress site you point it at, through the REST API that is built into WordPress, using credentials you provide. It only reads and writes content on that site, and only what you ask for. You are responsible for having the right to publish the data you import (for example scraped content, product photos and descriptions) and for handling personal data you export (such as WooCommerce customers and orders) in line with GDPR, CCPA and other laws that apply to you.
WordPress and WooCommerce are trademarks of the WordPress Foundation and Automattic Inc. This actor is not affiliated with, endorsed by or sponsored by them.