Linux 软件免费装
Banner图

Contentrain Bridge – Export to Markdown, JSON & Git

开发者 abb65
更新时间 2026年10月30日 17:41
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

export markdown astro headless static site

下载

0.8.4 0.8.5

详情介绍:

Contentrain Bridge turns your WordPress content into editable JSON and Markdown under Tools > Contentrain Bridge. You choose the content, review how it is modelled and which interface text travels, then download a ZIP or send the result to a branch in your own GitHub repository. Both are free. Media travels with the content: uploads are copied into media/ and the content is relinked to them, so the delivered repository does not depend on this site for images. A file over 8 MB, or one missing from the uploads directory, keeps its WordPress URL and is named in the coverage report. Dynamic WordPress and plugin output is not rendered during a source scan. These limits are written into the coverage report rather than implied to be complete. Want a working Astro website instead of files? Contentrain Migrate, a separate paid service, connects to this plugin with a key you create and builds a complete Astro site from your content: https://migrate.contentrain.io/?utm_source=wordpress-org&utm_medium=readme External services The plugin contacts no host other than this site unless you choose GitHub delivery. Two options read this site's own pages over HTTP, the way a visitor would, and send nothing elsewhere: "Also read the text your pages render" (the home page, a post, a page, search and not-found) and, with it, the connected-services check (the home page's script hosts). GitHub — used only when you enter a repository and a token in step 3 and start the delivery. The plugin then calls the GitHub REST API at api.github.com to read the target repository's default branch (or the base branch you name) and file list, upload the exported files, and create one new branch holding them. What is sent: the exported content files you reviewed, a commit message, and the token you supplied. Nothing is sent to Contentrain or to any other host, and no analytics or telemetry is collected. The token is used for those requests only and is never stored in the database or in the export. Delivery never writes to your default branch and never overwrites a file you edited in Git. GitHub's terms: https://docs.github.com/site-policy/github-terms/github-terms-of-service — privacy policy: https://docs.github.com/site-policy/privacy-policies/github-privacy-statement REST export API (inbound) — the plugin adds routes under /wp-json/contentrain-bridge/v1/ that let a program you authorize start an export and read its files. The plugin sends nothing by itself: the program asks, with an application password of an administrator who has the export and manage_options capabilities, or with a Contentrain Migrate connection key (below). Contentrain Migrate uses these routes when you give it such a password or key to migrate this site; what Migrate then does with the content is governed by Contentrain's terms (https://contentrain.io/terms-of-service) and privacy policy (https://contentrain.io/privacy-policy). The program that starts an export chooses its scope: Migrate asks for private content (drafts, pending, scheduled, private and password-protected posts, never the password) and for comments, and the exported files carry each post's own status. These routes only read: no remote call creates, edits or deletes posts, settings, files, users, plugins or themes; the plugin writes only its own temporary export files outside the web root and its own bookkeeping options. Revoke the application password in your profile (or the connection key on the Bridge screen) to end that access; exports expire after a day. robots.txt (only when you turn it on) — Tools > Contentrain Bridge has a switch, off by default, "Let Contentrain Migrate read my pages and media". It changes only the robots.txt WordPress itself serves, through WordPress's robots_txt filter, and contacts no host. When you turn it on, robots.txt gains one group for the ContentrainMigrate crawler: the rules your robots.txt gives every crawler (User-agent: *), without the lines that close the whole site (a Disallow matching /), followed by Allow lines for the REST API (/wp-json/), your uploaded media (/wp-content/uploads/) and /. By robots.txt's longest-match rule those Allow lines open only those paths: a rule such as Disallow: /wp- still keeps wp-admin closed. Paths you keep closed, such as wp-admin, stay closed to it, and every other crawler sees robots.txt exactly as before. Turning it off removes the group, and uninstalling the plugin removes the setting. If your site serves a robots.txt file from disk, WordPress cannot change it: the switch stays off and the screen shows the lines to add yourself.

安装:

  1. In Plugins > Add New, search for "Contentrain Bridge" and install it. You can also download contentrain-bridge.zip from the latest GitHub release (https://github.com/Contentrain/wordpress-bridge/releases/latest), the same archive, and install it with Plugins > Add New > Upload Plugin.
  2. Activate Contentrain Bridge in WordPress.
  3. Open Tools > Contentrain Bridge.
  4. Step 1: choose content types and options, then prepare the content.
  5. Step 2: review the generated models and the interface-text candidates, then validate and finalize.
  6. Step 3: download the ZIP, or deliver to a branch in your own GitHub repository.
Updates arrive through WordPress like any other plugin's, from the WordPress.org directory. A ZIP installed from a GitHub release is updated by uploading the newer release ZIP the same way; WordPress replaces the installed version. Export snapshots are temporary and are not affected.

屏幕截图:

  • Step 2: review the content models and the interface text that travels with them.
  • Step 3: download a ZIP or deliver the export to a new branch in your own GitHub repository.
  • The coverage report: every place WordPress keeps content, counted and split into what was exported, what was left out and why.

常见问题:

Is Contentrain Migrate or Studio required?

No. Modelling, validation, the ZIP download and GitHub delivery are all local and free. Migrate is an optional later step if you want an Astro website.

Does the plugin send telemetry?

No. It collects no analytics and contacts no Contentrain server. The only request to another host is to the GitHub API, when you start a GitHub delivery yourself.

Are media files exported?

Yes, when you include the Media type. Each upload and its generated sizes are copied into media/ in the export, and content that pointed at a WordPress upload URL is rewritten to that path, so images keep working after this site is gone. Media records also keep the original URL. Files larger than 8 MB, files missing from disk, and anything past the export's total media budget keep their WordPress URL instead of being half-copied; the coverage report lists them. The 8 MB ceiling exists because GitHub delivery has to hold a file in memory to upload it.

What is the Contentrain Migrate connection key?

A way for Contentrain Migrate to read this site's content when your host blocks application passwords (some hosts strip the Authorization header they travel in). Create it under Tools > Contentrain Bridge and paste it into Migrate. What it allows: Migrate can ask this site to prepare a content export and download it — published posts, pages and custom post types with their fields and metadata (secret-looking keys are always left out); if Migrate asks for it, draft, pending, scheduled, private and password-protected content too (never the password itself); media records (the files only if requested); categories, tags and menus; comments without email addresses or IP addresses; SEO, redirect and permalink settings; theme design settings; the names and versions of active plugins and the theme; and the number of published entries per content type. What it cannot do: it runs with no WordPress user and cannot change anything on this site — no post, setting, file, user, plugin or theme is written. It does not open the WordPress REST API, wp-admin or application passwords; it works only on the plugin's own export routes. The key is valid only while the administrator who created it still has the export and manage_options capabilities. Revoking: revoke it on the same screen at any time; creating a new key retires the old one, and revoking removes the exports it prepared. It is shown once and only a fingerprint of it is stored. Paste it into Migrate within an hour; once Migrate has used it, it works for that one move until 14 days after it was created, until Migrate closes it when the move is done, or until you revoke it or create a new one. It can only be created and used over HTTPS. Nothing is sent from your site to Contentrain when you create it.

Why would I let Contentrain Migrate read my pages and media in robots.txt?

Contentrain Migrate respects robots.txt. If yours closes the site to crawlers (for example with "Discourage search engines from indexing this site"), Migrate cannot read your pages and media to move them. The switch opens the site to the ContentrainMigrate crawler only, keeps what you close for every crawler closed to it as well (it drops only the lines that close the whole site, and opens the REST API and your uploaded media), and changes nothing for other crawlers. It is off until you turn it on, and you can turn it off at any time. If Cloudflare (or another CDN) serves your robots.txt, for example Cloudflare's managed robots.txt, WordPress's robots.txt never reaches visitors and the switch cannot change it: add the lines the screen shows in that service's settings instead.

Which comment data is exported?

Only when explicitly selected: author name, URL, content, status, dates and relationships. Comments of every status are included (approved, pending, spam and trash), each with its status, so you can leave out the ones you do not want to keep. Email addresses, IP addresses, user-agent values and comment metadata are excluded.

What does the source scan read?

The active theme and child theme, and optionally the source files of active plugins. It reads PHP, HTML and JavaScript text to find interface strings, never executes them, skips vendor and dependency directories, and stops at 10,000 files. Every string it finds is a candidate you review before it becomes content.

更新日志:

0.8.5 0.8.4 0.8.3 0.8.2 0.8.1 0.8.0 0.7.1 0.7.0 0.6.5 0.6.4 0.6.3 0.6.2 0.6.1 0.6.0 0.5.0 0.4.0 0.3.1 0.3.0 0.2.1 0.2.0 0.1.0