{"id":40797,"date":"2015-12-17T22:02:51","date_gmt":"2015-12-17T22:02:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/csv-importer-improved\/"},"modified":"2016-10-10T00:25:32","modified_gmt":"2016-10-10T00:25:32","slug":"csv-importer-improved","status":"publish","type":"plugin","link":"https:\/\/szl.wordpress.org\/plugins\/csv-importer-improved\/","author":3167320,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.6.1","stable_tag":"0.6.1","tested":"4.6.30","requires":"3.0.0","requires_php":"","requires_plugins":"","header_name":"CSV Importer Improved","header_author":"Jason judge, Denis Kobozev","header_description":"","assets_banners_color":"7995aa","last_updated":"2016-10-10 00:25:32","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"","rating":3.2,"author_block_rating":0,"active_installs":100,"downloads":11524,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"0.3.8":"<p>Added a check to see if the user is allowed to create posts and pages prior\nto importing.<\/p>","0.3.7":"<p>More robust handling of hierarchical custom taxonomies; removed deprecation\nwarnings.<\/p>","0.3.6":"<p>Fix for &#039;Invalid argument supplied for foreach() on line 268&#039; error message<\/p>","0.3.5":"<p>Subcategory creation support. Documentation update.<\/p>","0.3.4":"<p>Post parent support. Documentation update.<\/p>","0.3.3":"<p>Fixes &quot;Call to undefined function post_type_exists()&quot; error for versions of\nWordpress prior to 3.0<\/p>","0.3.2":"<p>Adds support for custom post types. Option to import pages has been removed from\nthe interface. To import a page, add csv_post_type column to your csv file and\nset it to &quot;page&quot;.<\/p>","0.3.1":"<p>Adds support for comments<\/p>","0.3.0":"<p>Adds support for custom taxonomies<\/p>"},"ratings":{"1":2,"2":0,"3":0,"4":1,"5":2},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1311249","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1311249","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"1356049","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.4.2","0.5.0","0.5.2","0.5.4","0.6.0","0.6.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1567386","resolution":"1","location":"plugin"}},"screenshots":{"1":"Plugin interface"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[11137,567,6590,87,9471],"plugin_category":[59],"plugin_contributors":[81609],"plugin_business_model":[],"class_list":["post-40797","plugin","type-plugin","status-publish","hentry","plugin_tags-batch","plugin_tags-csv","plugin_tags-excel","plugin_tags-import","plugin_tags-spreadsheet","plugin_category-utilities-and-tools","plugin_contributors-judgej","plugin_committers-judgej"],"banners":{"banner":"https:\/\/ps.w.org\/csv-importer-improved\/assets\/banner-772x250.jpg?rev=1356049","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/csv-importer-improved\/assets\/icon-128x128.png?rev=1311249","icon_2x":"https:\/\/ps.w.org\/csv-importer-improved\/assets\/icon-256x256.png?rev=1311249","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/csv-importer-improved\/trunk\/screenshot-1.png?rev=1567386","caption":"Plugin interface"}],"raw_content":"<!--section=description-->\n<p>This WordPress plugin imports posts from CSV (Comma Separated Value) files into your\nWordPress blog. It can prove extremely useful when you want to import a bunch\nof posts from an Excel document or the like - simply export your document into\na CSV file and the plugin will take care of the rest.<\/p>\n\n<p>https:\/\/wordpress.org\/plugins\/csv-importer-improved\/<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Imports post title, body, excerpt, tags, date, categories etc.<\/li>\n<li>Supports custom fields, custom taxonomies and comments<\/li>\n<li>Deals with Word-style quotes and other non-standard characters using\nWordPress' built-in mechanism (same one that normalizes your input when you\nwrite your posts)<\/li>\n<li>Columns in the CSV file can be in any order, provided that they have correct\nheadings<\/li>\n<li>Multi-language support<\/li>\n<\/ul>\n\n<p>This plugin is forked from https:\/\/wordpress.org\/plugins\/csv-importer\/ by dvkob\nin order to keep up with changes to the core WordPress.<\/p>\n\n<p>This importer writes directly to the database. It does not go through the internal\nWordPress objects for creating posts etc. That may be an advantage to you (it will\nbe faster for large imports) but do be aware of any data integrity issues that may arrise.<\/p>\n\n<p>Only UTF-8 encoding is supported, both with and without Byte Order Marks (BOM).<\/p>\n\n<p>The development repository for this plugin can be found here:<\/p>\n\n<p>https:\/\/github.com\/academe\/csv-importer-improved<\/p>\n\n<p>Please feel free to raise issues there, and submit pull requests, as well as through\nthe normal WordPress channels.<\/p>\n\n<h3>Usage<\/h3>\n\n<p>Click on the CSV Importer link on your WordPress admin page, choose the\nfile you would like to import and click Import. The <code>examples<\/code> directory\ninside the plugin's directory contains several files that demonstrate\nhow to use the plugin. The best way to get started is to import one of\nthese files and look at the results.<\/p>\n\n<p>CSV is a tabular format that consists of rows and columns. Each row in\na CSV file represents a post; each column identifies a piece of information\nthat comprises a post.<\/p>\n\n<p>You can create new posts, or update existing posts by supplying the csv_post_id\nfield pointing to an existing post. When updating, all field names you provide\nin the CSV file will be updated - even if blank - but fields you don't list at\nthe head of the CSV file will be left intact.<\/p>\n\n<h4>Basic post information<\/h4>\n\n<ul>\n<li><code>csv_post_id<\/code> - optional, used to update an existing post.<\/li>\n<li><code>csv_post_title<\/code> - title of the post<\/li>\n<li><code>csv_post_post<\/code> - body of the post<\/li>\n<li><code>csv_post_type<\/code> - <code>post<\/code>, <code>page<\/code> or a custom post type.\nFrom 0.3.2, <code>csv_post_type<\/code> column supports custom post types.\nRefer to the WordPress\n<a href=\"http:\/\/codex.wordpress.org\/Custom_Post_Types\">documentation on custom post types<\/a> for more info\non how to set up custom post types.<\/li>\n<li><code>csv_post_excerpt<\/code> - post excerpt<\/li>\n<li><code>csv_post_categories<\/code> - a comma separated list of category names or ids.\nThe list must be enclosed in quotes, e.g. \"EC &gt; UK, Island\".\nIf a chain of subcategories does not exist, e.g. <code>Animalia &gt; Chordata &gt; Mammalia<\/code>\nthen they will all be created and the post assigned to the end of the chain.\nThe parent category can also be defined using its id, e.g.\n    42 &gt; Primates &gt; Callitrichidae, where <code>42<\/code> is an\nexisting category id.<\/li>\n<li><code>csv_post_tags<\/code> - a \"quoted\" comma separated list of tags.<\/li>\n<li><code>csv_post_date<\/code> - most standard formats are supported.\nFor example, <code>now<\/code>, <code>11\/16\/2009 0:00<\/code>, <code>1999-12-31 23:55:00<\/code>, <code>+1 week<\/code>,\n    next Thursday, <code>last year<\/code> are all valid. For technical\ndetails, consult PHP's <code>strtotime()<\/code> function <a href=\"http:\/\/php.net\/manual\/en\/function.strtotime.php\">documentation<\/a>.<\/li>\n<\/ul>\n\n<h4>Custom fields<\/h4>\n\n<p>Any column that doesn't start with <code>csv_<\/code> is considered to be a custom field\nname. The data in that column will be imported as the custom fields value.<\/p>\n\n<p>All custom fields must be unique. Multiple fields with the same name will be\nupdated to the same value if updating an existing post.\nPrior to version 0.6.0 loading the same field name multiple times to an existing\npost would create multiple custom fields.<\/p>\n\n<h4>General remarks<\/h4>\n\n<ul>\n<li>WordPress pages <a href=\"http:\/\/codex.wordpress.org\/Pages\">don't have categories or tags<\/a>.<\/li>\n<li>Most columns are optional. Either <code>csv_post_title<\/code>, <code>csv_post_post<\/code> or\n    csv_post_excerpt are sufficient to create a post. If all of these\ncolumns are empty in a row, the plugin will skip that row.<\/li>\n<li>The plugin will attempt to reuse existing categories or tags; if an\nexisting category or tag cannot be found, the plugin will create it.<\/li>\n<li>To specify a category that has a greater than sign (&gt;) in the name, use\nthe HTML entity <code>&amp;gt;<\/code><\/li>\n<\/ul>\n\n<h4>Advanced usage<\/h4>\n\n<ul>\n<li><code>csv_post_author<\/code> - numeric user id or login name. If not specified or\nuser does not exist, the plugin will assign the posts to the user\nperforming the import.<\/li>\n<li><code>csv_post_slug<\/code> - post slug used in permalinks.<\/li>\n<li><code>csv_post_parent<\/code> - post parent id.<\/li>\n<\/ul>\n\n<h3>Custom taxonomies<\/h3>\n\n<p><strong>New in version 0.3.0<\/strong><\/p>\n\n<p>Once custom taxonomies are set up in your theme's functions.php file or\nby using a 3rd party plugin, <code>csv_ctax_(taxonomy name)<\/code> columns can be \nused to assign imported data to the taxonomies.<\/p>\n\n<p><strong>Non-hierarchical taxonomies<\/strong><\/p>\n\n<p>The syntax for non-hierarchical taxonomies is straightforward and is essentially\nthe same as the <code>csv_post_tags<\/code> syntax.<\/p>\n\n<p><strong>Hierarchical taxonomies<\/strong><\/p>\n\n<p>The syntax for hierarchical taxonomies is more complicated. Each hierarchical\ntaxonomy field is a tiny two-column CSV file, where <em>the order of columns\nmatters<\/em>. The first column contains the name of the parent term and the second\ncolumn contains the name of the child term. Top level terms have to be preceded\neither by an empty string or a 0 (zero).<\/p>\n\n<p>Sample <code>examples\/custom-taxonomies.csv<\/code> file included with the plugin\nillustrates custom taxonomy support. To see how it works, make sure to set up\ncustom taxonomies from <code>functions.inc.php<\/code>.<\/p>\n\n<p>Make sure that the quotation marks used as text delimiters in <code>csv_ctax_<\/code>\ncolumns are regular ASCII double quotes, not typographical quotes like \u201c\n(U+201C) and \u201d (U+201D).<\/p>\n\n<h3>Comments<\/h3>\n\n<p><strong>New in version 0.3.1<\/strong><\/p>\n\n<p>An example file with comments is included in the <code>examples<\/code> directory.\nIn short, comments can be imported along with posts by specifying columns\nsuch as <code>csv_comment_*_author<\/code>, <code>csv_comment_*_content<\/code> etc, where * is\na comment ID number. This ID doesn't go into WordPress. It is only there\nto have the connection information in the CSV file.<\/p>\n\n<h3>Credits<\/h3>\n\n<p>This plugin uses <a href=\"http:\/\/code.google.com\/p\/php-csv-parser\/\">php-csv-parser<\/a> by Kazuyoshi Tlacaelel.\nIt was inspired by JayBlogger's <a href=\"http:\/\/www.jayblogger.com\/the-birth-of-my-first-plugin-import-csv\/\">CSV Import<\/a> plugin.<\/p>\n\n<p>Contributors:<\/p>\n\n<ul>\n<li>Kevin Hagerty (post_author support)<\/li>\n<li>Edir Pedro (root category option and tableless HTML markup)<\/li>\n<li>Frank Loeffler (comments support)<\/li>\n<li>Micah Gates (subcategory syntax)<\/li>\n<li>David Hollander (deprecation warnings, linebreak handling)<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>Installing the plugin:<\/p>\n\n<ol>\n<li>Unzip the plugin's directory into <code>wp-content\/plugins<\/code>.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<li>The plugin will be available under Tools -&gt; CSV Importer on\nWordPress administration page.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<blockquote>\n  <p>I have quotation marks and commas as values in my CSV file. How do I tell CSV\n  Importer to use a different separator?<\/p>\n<\/blockquote>\n\n<p>It doesn't really matter what kind of separator you use if your file is\nproperly escaped. To see what I mean by proper escaping, take a look at\n    examples\/sample.csv file which has cells with quotation marks and commas.<\/p>\n\n<p>If the software you use for exporting to CSV is unable to escape quotation\nmarks and commas, you might want to give <a href=\"http:\/\/www.openoffice.org\/\">OpenOffice Calc<\/a> a try.<\/p>\n\n<blockquote>\n  <p>How can I import characters with diacritics, Cyrillic or Han characters?<\/p>\n<\/blockquote>\n\n<p>Make sure to save your CSV file with utf-8 encoding.<\/p>\n\n<p>Prior to version 6.0.4, MySQL <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/faqs-cjk.html#qandaitem-24-11-1-13\">did not support<\/a> some rare Han characters. As\na workaround, you can insert characters such as &#x2028e; (U+2028E) by\nconverting them to HTML entities - &amp;&#035;x2028e;<\/p>\n\n<blockquote>\n  <p>I cannot import anything - the plugin displays \"Imported 0 posts in 0.01\n  seconds.\"<\/p>\n<\/blockquote>\n\n<p>Update to version 0.3.1 or greater. Previous versions required write access to\nthe \/tmp directory and the plugin failed if access was denied by PHP's safe\nmode or other settings.<\/p>\n\n<blockquote>\n  <p>I'm importing a file, but not all rows in it are imported and I don't see\n  a confirmation message. Why?<\/p>\n<\/blockquote>\n\n<p>WordPress can be many things, but one thing it's not is blazing fast. The\nreason why not all rows are imported and there's no confirmation message is\nthat the plugin times out during execution - PHP decides that it has been\nrunning too long and terminates it.<\/p>\n\n<p>There are a number of solutions you can try. First, make sure that you're not\nusing any plugins that may slow down post insertion. For example, a Twitter\nplugin might attempt to tweet every post you import - not a very good idea\nif you have 200 posts. Second, you can break up a file into smaller chunks that\ntake less time to import and therefore will not cause the plugin to time out.\nThird, you can try adjusting PHP's <code>max_execution_time<\/code> option that sets how\nlong scripts are allowed to run. Description of how to do it is beyond the\nscope of this FAQ - you should search the web and\/or use your web host's help\nto find out how. However, putting the following line in <code>.htaccess<\/code> file inside\npublic_html directory works for some people:<\/p>\n<dl>\n<dt>Sets max execution time to 2 minutes. Adjust as necessary.<\/dt>\n<dd><p>php_value max_execution_time 120<\/p>\n\n<p>The problem can be approached from another angle, namely instead of giving\nscripts more time to run making them run faster. There's not much I can do to\nspeed up the plugin (you can contact me at dvkobozev at gmail.com if you like\nto prove me wrong), so you can try to speed up WordPress. It is a pretty broad\ntopic, ranging from database optimizations to PHP accelerators such as APC,\neAccelerator or XCache, so I'm afraid you're on your own here.<\/p>\n\n<blockquote>\n  <p>I receive the following error when I try to import my CSV file: \"Invalid CSV\n  file: header length and\/or row lengths do not match\". What's wrong with your\n  plugin\/my file?<\/p>\n<\/blockquote>\n\n<p>Short answer: update to version 0.2.0 or later. Longer answer: the number of\nfields (values) in rows in your file does not match the number of columns.\nVersion 0.2.0 pads such rows with empty values (if there are more columns than\ncells in a row) or discards extra fields (if there are less columns than cells\nin a row).<\/p>\n\n<blockquote>\n  <p>I'm getting the following error: <code>Parse error: syntax error, unexpected\n  T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in ...\/public_html\/wp-content\/plugins\/csv-importer\/File_CSV_DataSource\/DataSource.php\n  on line 61<\/code>. What gives?<\/p>\n<\/blockquote>\n\n<p>This plugin requires PHP5, while you probably have PHP4 or older. Update your\nPHP installation or ask your hosting provider to do it for you.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.6.0<\/h4>\n\n<ul>\n<li>Change behaviour of custom fields; treat all fields as unique and don't create duplicates.<\/li>\n<\/ul>\n\n<h4>0.5.4<\/h4>\n\n<ul>\n<li>No functional changes; just a forced update after fixing some SVN issues.<\/li>\n<\/ul>\n\n<h4>0.5.1<\/h4>\n\n<ul>\n<li>Fix incorrect intitial status.<\/li>\n<li>Started making strings translatable.<\/li>\n<\/ul>\n\n<h4>0.5.0<\/h4>\n\n<ul>\n<li>Update PHP version to 5.3+<\/li>\n<li>Support updating existing posts.<\/li>\n<\/ul>\n\n<h4>0.4.2<\/h4>\n\n<ul>\n<li>Renamed from \"CSV Importer 2\" to \"CSV Importer Improved\".<\/li>\n<\/ul>\n\n<h4>0.4.1<\/h4>\n\n<ul>\n<li>Fix some function name clashes with other CSV import plugins.<\/li>\n<\/ul>\n\n<h4>0.4.0<\/h4>\n\n<ul>\n<li>Fixes to support WordPress 4.4<\/li>\n<\/ul>\n\n<h4>0.3.8<\/h4>\n\n<ul>\n<li>Minor bug and security fixes<\/li>\n<\/ul>\n\n<h4>0.3.7<\/h4>\n\n<ul>\n<li>Make hierarchical custom taxonomy line splitting more robust<\/li>\n<li>Fix deprecation warnings<\/li>\n<\/ul>\n\n<h4>0.3.6<\/h4>\n\n<ul>\n<li>Fix category cleanup bug<\/li>\n<\/ul>\n\n<h4>0.3.5<\/h4>\n\n<ul>\n<li>Added 'greater-than' category syntax<\/li>\n<li>Updated the docs<\/li>\n<\/ul>\n\n<h4>0.3.4<\/h4>\n\n<ul>\n<li>Added csv_post_parent column<\/li>\n<li>Updated the docs<\/li>\n<li>Got rid of a deprecation warning<\/li>\n<\/ul>\n\n<h4>0.3.3<\/h4>\n\n<ul>\n<li>Fixes incompatibility with versions of WordPress prior to 3.0 introduced\nin previous release.<\/li>\n<\/ul>\n\n<h4>0.3.2<\/h4>\n\n<ul>\n<li>Added ability to specify custom post type.<\/li>\n<\/ul>\n\n<h4>0.3.1<\/h4>\n\n<ul>\n<li>Import comments.<\/li>\n<li>Updated php-csv-parser - the plugin should no longer create files in \/tmp.<\/li>\n<\/ul>\n\n<h4>0.3.0<\/h4>\n\n<ul>\n<li>Custom taxonomies.<\/li>\n<\/ul>\n\n<h4>0.2.4<\/h4>\n\n<ul>\n<li>Root category selection, cleaner HTML.<\/li>\n<\/ul>\n\n<h4>0.2.3<\/h4>\n\n<ul>\n<li>Slight speed increase, support for post_author and post_name.<\/li>\n<\/ul>\n\n<h4>0.2.2<\/h4>\n\n<ul>\n<li>Bugfix release to deal with BOM that may occur in UTF-8 encoded files.<\/li>\n<\/ul>\n\n<h4>0.2.1<\/h4>\n\n<ul>\n<li>Ability to import rows as pages, not posts.<\/li>\n<li>Starting with this version, you can also specify category ids instead of\nnames.<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<ul>\n<li>Ability to handle CSV files where the number of cells in rows does not\nmatch the number of columns<\/li>\n<li>Smart date parsing<\/li>\n<li>Code cleanup.<\/li>\n<\/ul>\n\n<h4>0.1.3<\/h4>\n\n<ul>\n<li>New option to import posts with published status.<\/li>\n<\/ul>\n\n<h4>0.1.2<\/h4>\n\n<ul>\n<li>Added support for post excerpts.<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>Code cleanup<\/li>\n<li>Changed column names for CSV input. Sorry if it breaks anything for you,\nfolks, but it had to be done in order to allow for custom fields such as\n    title (<a href=\"http:\/\/wordpress.org\/extend\/plugins\/all-in-one-seo-pack\/\">All in One SEO Pack<\/a> uses those, for example).<\/li>\n<\/ul>\n\n<h4>v0.1.0<\/h4>\n\n<ul>\n<li>Initial version of the plugin<\/li>\n<\/ul>","raw_excerpt":"Import posts from CSV files into WordPress.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/40797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=40797"}],"author":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/judgej"}],"wp:attachment":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=40797"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=40797"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=40797"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=40797"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=40797"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=40797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}