Skip to content

About

Export WordPress posts and pages to JSON via REST API

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Export to JSON Posts

Contributors: paisionut
Tags: json, export, rest api, api
Requires at least: 5.4
Tested up to: 6.8
Stable tag: 2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Export WordPress posts and pages to JSON via REST API with full configuration options.

Description

This WordPress plugin provides two REST API endpoints to export posts and pages to JSON format. Features include configurable post types, statuses, category exclusion, pagination, and flexible filtering.

Features

Two REST API Endpoints

  • Public endpoint: /wp-json/etjp/v1/export (no authentication required)
  • Admin endpoint: /wp-json/etjp/v1/posts (requires administrator or editor role)

Admin Settings Page

  • Configure default posts per page
  • Select default post types (post, page, custom)
  • Select default post statuses (admin endpoint only)
  • Exclude specific categories from export

API Parameters

  • page - Page number
  • items - Items per page
  • order - Order direction (DESC/ASC)
  • orderby - Order by field (ID, date, title, modified)
  • status - Override post status
  • type - Override post type
  • exclude_cat - Exclude categories (comma-separated IDs)
  • search - Search posts by title/content
  • author - Filter by author ID
  • year - Filter by year
  • monthnum - Filter by month
  • debug - Return debug info (public endpoint)

JSON Output Includes

  • id, slug, title, content, excerpt
  • guid, permalink, featured_img
  • post_date, post_modified, post_date_gmt, post_modified_gmt
  • status, type, author, author_id
  • tags, categories, comment_count

Installation

  1. Upload the plugin directory to /wp-content/plugins/
  2. Activate through WordPress plugins menu
  3. Configure settings in WordPress admin under "Export to JSON"

API Usage

Public Endpoint (no auth)

/wp-json/etjp/v1/export

Admin Endpoint (requires admin/editor)

/wp-json/etjp/v1/posts

Example Requests

/wp-json/etjp/v1/export?items=50&order=ASC
/wp-json/etjp/v1/export?type=post,page&exclude_cat=1,2
/wp-json/etjp/v1/posts?status=publish,private&author=1

Changelog

2.0

  • Complete plugin rewrite with admin settings page
  • Configurable post types, statuses, and category exclusion
  • Extended API parameters for filtering
  • Modern admin UI with sidebar

1.5

  • Added public export endpoint

1.4

  • Initial release improvements

License

GPL v2 or later - see LICENSE.txt

About

Export WordPress posts and pages to JSON via REST API

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages