Skip to content

clas-web/multisite-csv-importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multisite CSV Importer

  • Tags: multisite, csv, import, batch, spreadsheet, csv
  • Version: 0.2.0
  • Author: Crystal Barton
  • Description: Imports posts, taxonomies, etc. to blogs within a multisite install of WordPress using CSV files. This is an altered version of the CSV Importer authored by Denis Kobozev.

Import posts from CSV files into WordPress.

Description

This plugin imports posts from CSV (Comma Separated Value) files into your WordPress blog. It can prove extremely useful when you want to import a bunch of posts from an Excel document or the like - simply export your document into a CSV file and the plugin will take care of the rest.

Features

  • Imports post title, body, excerpt, tags, date, categories, etc. into a site within the multisite WordPress install.
  • Supports custom fields and custom taxonomies.
  • Deals with Word-style quotes and other non-standard characters using WordPress' built-in mechanism (same one that normalizes your input when you write your posts)
  • Columns in the CSV file can be in any order, provided that they have correct headings
  • Multilanguage support

Installation

Installing the plugin:

  1. Unzip the plugin's directory into wp-content/plugins.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. The plugin will be available under Tools -> Multisite CSV Importer on WordPress administration page.

Usage

Click on the Multisite CSV Importer link on your WordPress network admin page, choose the file you would like to import and click Import. The examples directory inside the plugin's directory contains several files that demonstrate how to use the plugin. The best way to get started is to import one of these files and look at the results.

CSV is a tabular format that consists of rows and columns. Each row in a CSV file represents a post, page, link, or taxonomy terms.

First Column

The first column of each row indicates how the row should be processed.

  • h : Indicates that the row contains header information (usually the first row of the spreadsheet). All rows before the first header row are ignored.
  • # : Comments out the row. This row will be ignored and not processed at all.

Posts and Pages

Required Fields

These four fields are required for all posts and pages.

  • site : The slug of the site.
  • type : "post" or "page" or a custom post type.
  • action : The action to take on the object. There are a number fo actions that can be taken. Further details on each of the actions are detailed under the type section.
    • add : Adds a post or page, but does not check for duplicates before creation.
    • update : Updates a post or page, if it exists.
    • replace : Replaces a post or page, if it exists, otherwise it creates the post.
    • prepend : Prepends data to a post or page's excerpt and content.
    • append : Appends data to a post or page's excerpt and content.
    • delete : Deletes a post or page.
    • grep : Updates a portion of a post or page using a regex expression and replacement text. Requires the "subject" column. Valid subject values: "title", "excerpt", "content", "slug", "guid"
  • title : The title of the post or page.

Adding Posts or Pages

  • site : The slug of the site.
  • type : "post" or "page" or custom post type
  • action : "add"
    • add : Adds a post or page, but does not check for duplicates before creation.
  • title : The title of the post or page.
  • excerpt : The excerpt of the post or page.
  • content : The content of the post or page.
  • date : The creation post datetime.
  • author : The post author's username.
  • slug : The post's slug or name.
  • guid : The GUID for the post.
  • parent : The title or the parent post (default: no parent).
  • status : The post's status . Valid options are: "publish", "pending", "draft", "future", "private", "trash".
  • menu-order : The int value given to determine the posts order in the menu.
  • password : Password for post (default: no password).
  • categories : One or more categories seperated by a comma. Posts only.
  • tags : One or more tags seperated by a comma. Posts only.
  • taxonomy-{taxonomy-slug} : One or more custom taxonomy names separated by a comma.

Updating and Replacing Posts or Pages

  • site : The slug of the site.
  • type : "post" or "page" or custom post type
  • action : "update" or "replace"
    • update : Updates a post or page, if it exists.
    • replace : Replaces a post or page, if it exists, otherwise it creates the post.
  • title : The title of the post or page.
  • excerpt : The excerpt of the post or page.
  • content : The content of the post or page.
  • date : The creation post datetime.
  • author : The post author's username.
  • slug : The post's slug or name.
  • parent : The title or the parent post (default: no parent).
  • status : The post's status . Valid options are: "publish", "pending", "draft", "future", "private", "trash".
  • menu-order : The int value given to determine the posts order in the menu.
  • password : Password for post (default: no password).
  • categories : One or more categories seperated by a comma. Posts only.
  • tags : One or more tags seperated by a comma. Posts only.
  • taxonomy-{taxonomy-slug} : One or more custom taxonomy names separated by a comma.

Prepending and Appending to Posts or Pages

  • site : The slug of the site.
  • type : "post" or "page" or custom post type
  • action : "prepend" or "append"
    • prepend : Prepends data to a post or page's excerpt and content.
    • append : Appends data to a post or page's excerpt and content.
  • title : The title of the post or page.
  • excerpt : The content to pre- or append to the post excerpt.
  • content : The content to pre- or append to the post content.

Deleting Posts or Pages

  • site : The slug of the site.
  • type : "post" or "page" or custom post type
  • action : "delete"
    • delete : Deletes a post or page.
  • title : The title of the post or page.

GREP Posts or Pages

  • site : The slug of the site.
  • type : "post" or "page" or custom post type
  • action : "grep"
    • grep : Updates a portion of a post or page using a regex expression and replacement text. Valid subject values: title, excerpt, content, slug, guid
  • title : The title of the post or page.
  • subject : The subject of the search and replace. Valid options are: "title", "excerpt", "content", "slug", or "guid".
  • regex : The regex to match against the subject.
  • replace-text : The text to replace the matched portion of the subject.

Add, Updating, or Deleting Taxonomy Terms

  • site : The slug of the site.
  • type : "post" or custom post type Page type do not support taxonomies.
  • action : "add-taxonomy", "update-taxonomy", "delete-taxonomy"
  • title : The title of the post or page.
  • categories : One or more categories seperated by a comma.
  • tags : One or more tags seperated by a comma.
  • taxonomy-{taxonomy-slug} : One or more custom taxonomy names separated by a comma.

Links

Required Fields

These four fields are required for all links.

  • site : The slug of the site.
  • type : "link"
  • action : The action to take on the object. There are a number fo actions that can be taken. Further details on each of the actions are detailed under the type section.
    • add : Adds a link, but does not check for duplicates before creation.
    • update : Updates a link, if it exists.
    • replace : Replaces a link, if it exists, otherwise it creates the link.
    • delete : Deletes a link.
    • grep : Updates a portion of a link using a regex expression and replacement text. Requires the "subject" column. Valid subject values: "name", "url", "description"
  • name : The name/title of the link.

Adding Links

  • site : The slug of the site.
  • type : "link"
  • action : "add"
    • add : Adds a post or page, but does not check for duplicates before creation.
  • name : The name/title of the link.
  • name : The name/title of the link.
  • url : The url for the anchor link.
  • description : The description for the link.
  • target : The target for the anchor. Valid options are: "_blank", "_top", "_none".
  • categories : One or more categories seperated by a comma.

Updating and Replacing Links

  • site : The slug of the site.
  • type : "link"
  • action : "update" or "replace"
    • update : Updates a link, if it exists.
    • replace : Replaces a link, if it exists, otherwise it creates the link.
  • name : The name/title of the link.
  • url : The url for the anchor link.
  • description : The description for the link.
  • target : The target for the anchor. Valid options are: "_blank", "_top", "_none".
  • categories : One or more categories seperated by a comma.

Deleting Links

  • site : The slug of the site.
  • type : "link"
  • action : "delete"
    • delete : Deletes a link.
  • name : The name/title of the link.

GREP Links

  • site : The slug of the site.
  • type : "link"
  • action : "grep"
    • grep : Updates a portion of a link using a regex expression and replacement text.
  • name : The name/title of the link.
  • subject : The subject of the search and replace. Valid options are: "name", "url", "description".
  • regex : The regex to match against the subject.
  • replace-text : The text to replace the matched portion of the subject.

Taxonomies

Required Fields

These four fields are required for all posts and pages.

  • site : The slug of the site.
  • type : "taxonomy"
  • action : The action to take.
    • add : Adds the taxonomy terms specified.
    • delete : Deletes the taxonomy terms specified.
  • name : The name of the taxonomy.
  • terms : The terms to add or delete.

Releases

No releases published

Packages

No packages published

Languages