Pagerail – Sync from Notion

Description

Write in Notion, publish in WordPress. Pagerail turns the rows of a Notion database into WordPress posts or pages and keeps them up to date. Content becomes native Gutenberg blocks, images are copied into your Media Library, and nothing on your site depends on Notion staying online.

Pagerail syncs any number of Notion databases and single pages, with no limit on sources or rows.

Teams that use Notion as a CMS for WordPress keep drafting, reviewing and scheduling in a Notion database; a status property decides what gets published, and Pagerail publishes the Notion pages to WordPress on a schedule or when you click Sync now. If you only want to import a Notion database into WordPress once, run one sync and then untick “Include this source in the automatic scheduled sync”.

What it does

  • Database posts, pages or any post type. One sync source maps one Notion database to the post type you choose: posts, pages or any public custom post type that uses the editor. Single Notion pages can be synced too.
  • Field mapping with sensible defaults. Title, slug, status, publish date, excerpt, categories, tags and featured image (a files/URL property or the page cover). Pagerail suggests the mapping from your property names and types.
  • Status mapping. Map Notion status/select/checkbox values to Published, Draft, Pending review, Private or “don’t sync”. Optional row filter (“only rows where Publish is checked”).
  • Real block editor content. Paragraphs with bold/italic/strikethrough/code/underline and links, headings, nested bulleted/numbered lists, to-do lists, quotes, callouts, code with language, dividers, tables, toggles (as Details blocks), columns, images with captions and alt text, video/embeds (oEmbed when WordPress supports the provider), bookmarks, files and PDFs, equations, synced blocks. Nested toggles and callouts work at any depth. Posts open in the block editor without “invalid block” warnings.
  • Images that don’t break. Notion file links expire after an hour, so Pagerail downloads images into the Media Library, de-duplicates them and reuses them on later syncs.
  • Links between pages. A link or mention of another synced Notion page becomes the WordPress permalink. Otherwise it links to the Notion page or becomes plain text (your choice).
  • Readable on every theme. Notion text colours are ignored by default (optional setting to keep them).
  • Incremental and safe. Only changed rows are rewritten. Rows deleted or archived in Notion can move the post to the Trash, back to Draft, or be ignored. Large databases sync in small batches that resume where they stopped, so there are no server timeouts.
  • Adopt existing posts. Optionally match Notion rows to existing WordPress posts by slug or by a “WP ID” property, so old content can be managed from Notion without duplicates.
  • Scheduled sync (WP-Cron) every 15 minutes, hourly, twice daily or daily, a Sync now button with live progress, and a warning when WP-Cron has not run recently.
  • Clear onboarding. After you paste your Notion API token, Pagerail shows exactly which databases your connection can see. If it sees none, it tells you how to share a database with the connection.
  • Sync log and diagnostics. The last 200 log entries on the settings page, an admin notice on errors, and a Copy diagnostics button (versions, settings and recent log lines, never your token) for support requests.
  • Per-post actions. “Re-sync from Notion” and “Edit in Notion” links in the Posts and Pages lists.
  • WP-CLI. wp pagerail sync [--source=<id>] [--dry-run] [--force], wp pagerail sources, wp pagerail log, wp pagerail connect, wp pagerail add-source. A real server cron job running wp pagerail sync works on cached or password-protected sites where WP-Cron does not fire.

Pagerail Pro

The free plugin has no limits. An optional, separate add-on adds integrations whose code is not in this plugin: custom fields (post meta and ACF), any taxonomy, Yoast SEO and Rank Math fields, author mapping by email, a sync webhook for Notion automations, Make and Zapier, and writing the WordPress URL and status back to Notion.

Pagerail Pro is a one-time purchase with lifetime updates: Pagerail Pro features and pricing.

Privacy

Pagerail does not track you and sends no data to the plugin author. It only talks to the Notion API with the token you provide, and downloads the images and files that your Notion pages contain. See “External services” below.

External services

This plugin connects to the Notion API (https://api.notion.com), a service run by Notion Labs, Inc., to read the databases and pages you have shared with your Notion connection.

  • What is sent: your Notion API token (in the Authorization header) and the IDs of the databases, data sources, pages and blocks to read. No data about your WordPress site or its visitors is sent.
  • When: when you click “Test connection”, list databases, add a sync source or sync (manually, on the schedule you choose, or with WP-CLI).
  • Files: images and files in your Notion content are downloaded from the URLs Notion provides (usually Notion’s Amazon S3 storage, prod-files-secure.s3.us-west-2.amazonaws.com), or from the external URL you embedded. Only https URLs on public addresses are downloaded.
  • Notion terms of use: https://notion.notion.site/Terms-and-Privacy-28ffdd083dc3473e9c2da6ec011b58ac
  • Notion privacy policy: https://www.notion.com/trust/privacy-policy

Screenshots

Installation

  1. Install and activate Pagerail from Plugins Add New (or upload the zip).
  2. In Notion, open the developer portal (https://app.notion.com/developers/connections), create a new connection with the API token authentication method (“read content” is enough) and copy the token.
  3. In Notion, open your database, click ••• Connections and add your connection. Pagerail can only see pages and databases you share this way.
  4. In WordPress, go to Settings Pagerail, paste the token, click Save token and then Test connection. Your database appears in the list.
  5. Click Add sync source (or “Use this database”), check the field and status mapping, choose the post type, and save.
  6. Click Sync now. After that, Pagerail syncs on the schedule you choose under Settings (hourly by default).

Recommended database properties (mapped automatically): Name (title), Slug (text), Status (status: Draft, In review, Published, Archived), Publish date (date), Excerpt (text), Category (select), Tags (multi-select), Featured image (files & media).

Optional, for sites where WP-Cron does not run reliably (page cache, basic auth, low traffic): add a real server cron job, e.g. every 15 minutes: cd /path/to/wordpress && wp pagerail sync --quiet.

FAQ

Pagerail says it cannot find any databases

Your database is not shared with your Notion connection yet. In Notion, open the database (the full-page view, not a linked view), click ••• in the top right Connections find your connection and confirm. Then click Refresh under “Databases shared with this connection” on the Pagerail settings page. Sharing a parent page also shares the databases inside it.

The sync finished but no posts appeared

Check the status mapping: rows whose status maps to “Don’t sync” (e.g. Idea, Archived) are skipped, as are rows that don’t match the optional row filter. The sync log on the settings page says how many rows were “not synced”.

Does it sync both ways?

No. Notion is the source of truth; changes made to a synced post in WordPress are overwritten by the next sync of that row.

What happens when I delete a row in Notion?

You choose per source: move the post to the Trash (default), set it back to Draft, or leave it alone. If the row comes back, the post is restored.

Are my images safe when Notion links expire?

Yes. Images are copied into your Media Library during the sync, so your posts never point at expiring Notion URLs. Unchanged images are not downloaded again.

Which Notion blocks are supported?

Paragraphs, headings (incl. toggle headings), bulleted/numbered/to-do lists, quotes, callouts, code, dividers, tables, toggles, columns, images, video, audio, embeds, bookmarks, files, PDFs, equations (as code) and synced blocks. Child pages and child databases are skipped (they can be synced as their own source). Unknown blocks are skipped safely and listed in the log.

Scheduled syncs don’t run

WP-Cron only runs when someone visits your site, and some page caches or password protection stop it. Pagerail warns you on its settings page when this happens. Add a real cron job that runs wp pagerail sync, or use the “Sync now” button.

Is my Notion token safe?

It is stored encrypted (AES-256-GCM with a key derived from your site’s security salts), not autoloaded, never shown again in full and never included in diagnostics. You can also define it in wp-config.php as PAGERAIL_NOTION_TOKEN.

How many databases can I sync?

As many as you like. Each sync source is one Notion database or one single page; there is no limit on the number of sources or rows.

Will deleting the plugin delete my posts?

No, not by default. Under “When Pagerail is deleted” on the settings page you can opt in to removing its settings, and separately the synced posts and imported media.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Pagerail – Sync from Notion” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

0.2.1

  • A dismissible box about the optional Pagerail Pro add-on on the Pagerail settings screen and an “Upgrade” link in the Plugins list. Both are hidden while Pagerail Pro is active. No free feature depends on it.
  • Fix: wp pagerail sync could resume up to a second before Notion’s Retry-After period was over (whole-second rounding); it now always waits the full period.
  • Readme: shorter description and tags that match what the plugin does.

0.1.1

  • No limit on the number of database sources.
  • Any public post type that uses the editor can be a sync target (not only posts and pages).
  • Sync frequency setting: every 15 minutes, hourly, twice daily or daily.
  • Source editor input is read field by field and sanitized before it is used.
  • The sync lock is now atomic (two simultaneous syncs can no longer both start).
  • Updated links to Notion’s terms and privacy policy.

0.1.0

  • First release: Notion database and single-page sync to posts or pages, field and status mapping, row filter, Gutenberg block conversion, Media Library image import with de-duplication, links between synced pages, incremental and resumable batches, hourly WP-Cron sync, removal handling (trash/draft/ignore), adopt existing posts, sync log, diagnostics, row actions, WP-CLI commands, uninstall cleanup.