平台开发中,欢迎参与测试。你可以在 QQ群:1046115671 中与我们交流,或是直接在社区发帖。

CSV Importer

帮助改进此插件的 简体中文 翻译~ 同时,你可以通过安装 WP-China-Yes 插件,并切换应用市场为“LitePress 应用市场”来接收翻译推送。

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.
  • Supports custom fields, custom taxonomies and comments
  • 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
  • Multi-language support

Usage

Click on the CSV Importer link on your WordPress 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; each column identifies a piece of information
that comprises a post.

Basic post information

  • csv_post_title – title of the post
  • csv_post_post – body of the post
  • csv_post_typepost, page or a custom post type.
    New in version 0.3.2
    In prior versions, importing rows as pages could be specified on a
    per-file basis using the plugins UI. In 0.3.2, csv_post_type column
    was added to support custom post types as well.
    Refer to the WordPress
    documentation on custom post types for more info
    on how to set up custom post types.
  • csv_post_excerpt – post excerpt
  • csv_post_categories – a comma separated list of category names or ids.
    New in version 0.3.5
    It’s also possible to assign posts to non-existing subcategories, using
    > to denote category relationships, e.g. Animalia > Chordata > Mammalia.
    If any of the categories in the chain does not exist, the plugin will
    automatically create it. It’s also possible to specify the parent category
    using an id, as in 42 > Primates > Callitrichidae, where 42 is an
    existing category id.
  • csv_post_tags – a comma separated list of tags.
  • csv_post_date – about any English textual description of a date and time.
    For example, now, 11/16/2009 0:00, 1999-12-31 23:55:00, +1 week,
    next Thursday, last year are all valid descriptions. For technical
    details, consult PHP’s strtotime() function documentation.

Custom fields

Any column that doesn’t start with csv_ is considered to be a custom field
name. The data in that column will be imported as the custom fields value.

General remarks

  • WordPress pages don’t have categories or tags.
  • Most columns are optional. Either csv_post_title, csv_post_post or
    csv_post_excerpt are sufficient to create a post. If all of these
    columns are empty in a row, the plugin will skip that row.
  • The plugin will attempt to reuse existing categories or tags; if an
    existing category or tag cannot be found, the plugin will create it.
  • To specify a category that has a greater than sign (>) in the name, use
    the HTML entity >

Advanced usage

  • csv_post_author – numeric user id or login name. If not specified or
    user does not exist, the plugin will assign the posts to the user
    performing the import.
  • csv_post_slug – post slug used in permalinks.
  • csv_post_parent – post parent id.

Custom taxonomies

New in version 0.3.0

Once custom taxonomies are set up in your theme’s functions.php file or
by using a 3rd party plugin, csv_ctax_(taxonomy name) columns can be
used to assign imported data to the taxonomies.

Non-hierarchical taxonomies

The syntax for non-hierarchical taxonomies is straightforward and is essentially
the same as the csv_post_tags syntax.

Hierarchical taxonomies

The syntax for hierarchical taxonomies is more complicated. Each hierarchical
taxonomy field is a tiny two-column CSV file, where the order of columns
matters
. The first column contains the name of the parent term and the second
column contains the name of the child term. Top level terms have to be preceded
either by an empty string or a 0 (zero).

Sample examples/custom-taxonomies.csv file included with the plugin
illustrates custom taxonomy support. To see how it works, make sure to set up
custom taxonomies from functions.inc.php.

Make sure that the quotation marks used as text delimiters in csv_ctax_
columns are regular ASCII double quotes, not typographical quotes like “
(U+201C) and ” (U+201D).

Comments

New in version 0.3.1

An example file with comments is included in the examples directory.
In short, comments can be imported along with posts by specifying columns
such as csv_comment_*_author, csv_comment_*_content etc, where * is
a comment ID number. This ID doesn’t go into WordPress. It is only there
to have the connection information in the CSV file.

Credits

This plugin uses php-csv-parser by Kazuyoshi Tlacaelel.
It was inspired by JayBlogger’s CSV Import plugin.

Contributors:

  • Kevin Hagerty (post_author support)
  • Edir Pedro (root category option and tableless HTML markup)
  • Frank Loeffler (comments support)
  • Micah Gates (subcategory syntax)
  • David Hollander (deprecation warnings, linebreak handling)

屏幕截图

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 -> CSV Importer on
    WordPress administration page.

0.3.8

  • Minor bug and security fixes

0.3.7

  • Make hierarchical custom taxonomy line splitting more robust
  • Fix deprecation warnings

0.3.6

  • Fix category cleanup bug

0.3.5

  • Added ‘greater-than’ category syntax
  • Updated the docs

0.3.4

  • Added csv_post_parent column
  • Updated the docs
  • Got rid of a deprecation warning

0.3.3

  • Fixes incompatibility with versions of WordPress prior to 3.0 introduced
    in previous release.

0.3.2

  • Added ability to specify custom post type.

0.3.1

  • Import comments.
  • Updated php-csv-parser – the plugin should no longer create files in /tmp.

0.3.0

  • Custom taxonomies.

0.2.4

  • Root category selection, cleaner HTML.

0.2.3

  • Slight speed increase, support for post_author and post_name.

0.2.2

  • Bugfix release to deal with BOM that may occur in UTF-8 encoded files.

0.2.1

  • Ability to import rows as pages, not posts.
  • Starting with this version, you can also specify category ids instead of
    names.

0.2.0

  • Ability to handle CSV files where the number of cells in rows does not
    match the number of columns
  • Smart date parsing
  • Code cleanup.

0.1.3

  • New option to import posts with published status.

0.1.2

  • Added support for post excerpts.

0.1.1

  • Code cleanup
  • Changed column names for CSV input. Sorry if it breaks anything for you,
    folks, but it had to be done in order to allow for custom fields such as
    title (All in One SEO Pack uses those, for example).

v0.1.0

  • Initial version of the plugin

CSV Importer 有 27 个评价

目前还没有评论

成为第一个评论 “CSV Importer” 的人