Really Simple CSV Importer

Por Webの相談所
(107 avaliações)
Baixar
  • Versão:
    1.3.1
  • Última atualização:
    há 2 dias
  • Instalações ativas:
    mais de 40 mil
  • Versão do WordPress:
    3.6 ou maior
  • Testado até o WordPress:
    7.0.2
  • Versão do PHP:
    ou maior
  • Tags:

Hospedagem WordPress com plugin Really Simple CSV Importer

Onde posso hospedar o plugin Really Simple CSV Importer?

Este plugin pode ser hospedado em qualquer servidor que tenha WordPress configurado. Recomendamos optar por uma empresa de hospedagem de confiança, com servidores otimizados para WordPress, como o serviço de hospedagem de sites da MCO2.

Hospedando o plugin Really Simple CSV Importer em um provedor confiável

A MCO2, além de configurar e instalar o WordPress na versão mais nova para seus clientes, oferece o WP SafePress, um mecanismo exclusivo que assegura e melhora seu site conjuntamente.

Por que a Hospedagem WordPress funciona melhor na MCO2?

A Hospedagem WordPress funciona melhor pois a MCO2 possui servidores otimizados para WordPress. A instalação de WordPress é diferente de uma instalação trivial, pois habilita imediatamente recursos como otimização automática de imagens, proteção da página de login, bloqueio de atividades suspeitas diretamente no firewall, cache avançado e HTTPS ativado por padrão. São plugins que potencializam seu WordPress para a máxima segurança e o máximo desempenho.

Alternative CSV Importer plugin. Simple and powerful, best for geeks.

You can get example CSV files in /wp-content/plugins/really-simple-csv-importer/sample directory.

Available column names and values:

  • ID or post_id: (int) post id.
    This value is not required. The post ID is already exists in your blog, importer will update that post data. If the ID is not exists, importer will trying to create a new post with suggested ID.
  • post_author: (login or ID) The user name or user ID number of the author.
  • post_author_login: The user name of the author.
  • post_date: (string) The time of publish date.
  • post_content: (string) The full text of the post.
  • post_title: (string) The title of the post.
  • post_excerpt: (string) For all your post excerpt needs.
  • post_status: (‘draft’ or ‘publish’ or ‘pending’ or ‘future’ or ‘private’ or custom registered status) The status of the post. ‘draft’ is default.
  • post_password: (string) The password to protect the post. The password is limited to 20 characters.
  • post_name: (string) The slug of the post.
  • post_parent: (int) The post parent id. Used for page or hierarchical post type.
  • menu_order: (int)
  • post_type: (‘post’ or ‘page’ or any other post type name) (required) The post type slug, not labels.
  • post_thumbnail: (string) The uri or path of the post thumbnail.
    E.g. http://example.com/example.jpg or /path/to/example.jpg
  • post_category: (string, comma separated) slug of post categories
  • post_tags: (string, comma separated) name of post tags
  • tax_{taxonomy}: (string, comma separated) Any field prefixed with tax_ will be used as a custom taxonomy. Taxonomy must already exist. Entries are names or slugs of terms.
  • {custom_field_key}: (string) Any other column labels used as custom field
  • cfs_{field_name}: (string) If you would like to import data to custom fields set by Custom Field Suite, please add prefix cfs_ to column header name.
  • scf_{field_name}: (string) If you would like to import data to custom fields set by Smart Custom Fields, please add prefix scf_ to column header name.
  • comment_status: (‘closed’ or ‘open’) Default is the option ‘default_comment_status’, or ‘closed’.

Note: Empty cells in the csv file means “keep it”, not “delete it”.
Note: To set the page template of a page, use custom field key of _wp_page_template.
Note: If providing a post_status of ‘future’ you must specify the post_date in order for WordPress to know when to publish your post.
Note: If the post_type value is attachment, you can use post_thumbnail field to define media URL or path.

Advanced Custom Fields plugin integrate

If advanced custom field key is exists, importer will trying to use update_field function instead of built-in add_post_meta function.
How to find advanced custom field key: Finding the field key

Official public repository

This plugin is now maintained by websoudan, taking over from the original author Takuro Hishikawa (@hissy). Thank you hissy for all the years of work!
Add star and read future issues about rs-csv-importer on GitHub!

Thanks

Cover banner designed by @luchino__

How to debug import data

Really Simple CSV Importer Debugger add-on enables you to dry-run-testing and show more detailed post, meta, taxonomy data of each csv row.
Download from gist.

How to customize import post data

There are three filters available in the importer.

really_simple_csv_importer_save_post

This filter is applied to post data.

Parameters:

  • $post – (array)(required) post data
  • $is_update – (bool) update existing post data, or insert new post data

Exemplo:

function really_simple_csv_importer_save_post_filter( $post, $is_update ) {

    // remove specific tag from import data
    if (isset($post['post_tags'])) {
        $_tags = array();
        foreach ($post['post_tags'] as $tag) {
            if ($tag != 'Apple') {
                $_tags[] = $tag;
            }
        }
        $post['post_tags'] = $_tags;
    }

    return $post;
}
add_filter( 'really_simple_csv_importer_save_post', 'really_simple_csv_importer_save_post_filter', 10, 2 );

really_simple_csv_importer_save_meta

This filter is applied to post meta data.

Parameters:

  • $meta – (array)(required) post meta data
  • $post – (array) post data
  • $is_update – (bool)

Exemplo:

function really_simple_csv_importer_save_meta_filter( $meta, $post, $is_update ) {

    // serialize metadata
    $meta_array = array();
    if (isset($meta['meta_key_1'])) $meta_array[] = $meta['meta_key_1'];
    if (isset($meta['meta_key_2'])) $meta_array[] = $meta['meta_key_2'];
    $meta = array( 'meta_key' => $meta_array );

    return $meta;
}
add_filter( 'really_simple_csv_importer_save_meta', 'really_simple_csv_importer_save_meta_filter', 10, 3 );

really_simple_csv_importer_save_tax

This filter is applied to post taxonomy data (categories and tags are not included, these are post data).

Parameters:

  • $tax – (array)(required) post taxonomy data
  • $post – (array) post data
  • $is_update – (bool)

Exemplo:

function really_simple_csv_importer_save_tax_filter( $tax, $post, $is_update ) {

    // Fix misspelled taxonomy
    if (isset($tax['actors'])) {
        $_actors = array();
        foreach ($tax['actors'] as $actor) {
            if ($actor == 'Johnny Dep') {
                $actor = 'Johnny Depp';
            }
            $_actors[] = $actor;
        }
        $tax['actors'] = $_actors;
    }

    return $tax;
}
add_filter( 'really_simple_csv_importer_save_tax', 'really_simple_csv_importer_save_tax_filter', 10, 3 );

really_simple_csv_importer_save_thumbnail

This filter is applied to thumbnail data.

Parameters:

  • $post_thumbnail – (string)(required) the thumbnail file path or distant URL
  • $post – (array) post data
  • $is_update – (bool)

Exemplo:

function really_simple_csv_importer_save_thumbnail_filter( $post_thumbnail, $post, $is_update ) {

    // Import a local file from an FTP directory
    if (!empty($post_thumbnail) && file_exists($post_thumbnail)) {
        $upload_dir   = wp_upload_dir();
        $target_path  = $upload_dir['path'] . DIRECTORY_SEPARATOR . basename($post_thumbnail);
        if (copy($post_thumbnail, $target_path)) {
            $post_thumbnail = $target_path;
        }
    }

    return $post_thumbnail;
}
add_filter( 'really_simple_csv_importer_save_thumbnail', 'really_simple_csv_importer_save_thumbnail_filter', 10, 3 );

How to customize the post data after importing to database

really_simple_csv_importer_post_saved

This action provides availability to run some tasks after importing.

Example: Download image from remote url to custom field (Download from gist)

How to customize the importing process entirely

really_simple_csv_importer_class

This filter provides availability to completely replace the RS_CSV_Importer#save_post method.

Example: Update row based on a custom field ID/key match (Download from gist)

Plugins semelhantes

Importador do WordPress
(313 avaliações)

Importe posts, páginas, comentários, campos personalizados, categorias, tags e mais de um arquivo de exportação WordPress.

Advanced Custom Fields (ACF®)
(1.437 avaliações)

ACF helps customize WordPress with powerful, professional and intuitive fields. Proudly powering over 2 million sites, WordPress developers love ACF.

TablePress – Facilite a criação de tabelas no WordPress
(4.624 avaliações)

Incorpore tabelas bonitas, acessíveis e interativas nos posts e páginas do seu site WordPress, sem precisar escrever código!

Widget Importer & Exporter
(117 avaliações)

Import and export your widgets.

WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets
(1.961 avaliações)

Easily import any file of any size into any plugin, post type, custom field, or taxonomy. Supports WooCommerce, ACF, images, galleries, users, real es …

Advanced Custom Fields: Extended
(132 avaliações)

All-in-one enhancement suite that improves WordPress & Advanced Custom Fields.

Do mesmo author (Webの相談所)

MW WP Form
(23 avaliações)

MW WP Form is shortcode base contact form plugin. This plugin have many features. For example you can use many validation rules, inquiry data saving, …