Skip to content

Add export/import functionality for documentation#289

Draft
Copilot wants to merge 6 commits into
developfrom
copilot/export-and-reimport-docs
Draft

Add export/import functionality for documentation#289
Copilot wants to merge 6 commits into
developfrom
copilot/export-and-reimport-docs

Conversation

Copilot AI commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Users needed ability to export documentation for backup and re-import to address backend display issues or migrate between sites.

Changes

Backend

  • Added ExportImport class handling JSON export/import via AJAX
  • Export captures complete doc structure: content, hierarchy, metadata (votes, contributors), tags, ordering
  • Import preserves parent-child relationships via ID mapping, skips existing docs by slug
  • Nonce verification and manage_options capability gating on both operations

Frontend

  • React component at #/export-import with separate export/import UIs
  • Export triggers JSON download with timestamp
  • Import validates JSON file, displays result summary (imported/skipped/errors)

Security

  • Input sanitization: wp_kses_post for content, sanitize_text_field for strings, absint for integers
  • Type-specific meta sanitization (votes as int, contributors as int array)
  • Tags and taxonomy terms sanitized during import

Data Structure

{
  "version": "2.1.18",
  "export_date": "2024-01-31 12:30:45",
  "docs": [{
    "id": 123,
    "title": "Doc Title",
    "parent": 0,
    "meta": {"positive": 5, "negative": 2},
    "tags": ["tag1", "tag2"]
  }],
  "tags": [{"name": "Tag", "slug": "tag", "description": "..."}]
}

Menu location: weDocs → Export/Import

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature] Export all docs to move to another page / re-import them</issue_title>
<issue_description>I'm currently facing the problem that still not all docs are shown in the backend, but in the front end. I thought about to export all those pages and re-import them. But I did not find this option in the plugin. Any chances this is considered?</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 31, 2026 11:36
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Copilot AI changed the title [WIP] Add feature to export and re-import documents Add export/import functionality for documentation Jan 31, 2026
@sapayth sapayth force-pushed the copilot/export-and-reimport-docs branch from 7c44118 to 089b399 Compare May 4, 2026 20:20
@sapayth sapayth force-pushed the copilot/export-and-reimport-docs branch from 330f0a0 to df5bb9a Compare May 17, 2026 18:51
@arifulhoque7 arifulhoque7 force-pushed the copilot/export-and-reimport-docs branch from 66a4132 to fcea386 Compare May 18, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Export all docs to move to another page / re-import them

3 participants