Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the CSV Importer plugin developed by dvkob. It works fine, may be because I upload only few posts each time (about 50).

What I need to know now, is how to add the meta data meta_value and meta_key. They should be inserted in the postmeta table. I'm a newbie in coding.

When importing directly via php-myadmin, I get a syntax error message. I suppose it depends on wrong sequence of fields.

Anyway, before wasting time shuffling fields and columns, can anybody help me? Which tool do I need? How do I format the csv file correctly?

Thanks, Patrick

share|improve this question
add comment

2 Answers

if you use the PHP-myadmin, you should EXPORT an sql dump of ALL your tables, and then IMPORT the same sql.

If I understand correctly (and maybe I am wrong) you try to import CSV into an SQL dump .. that will not work in direct sql dump.

after you have the sql dump, use the following :

 /**

    UPDATE wp_options SET option_value = REPLACE(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

    /**

    After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as abolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:

    **/

    UPDATE wp_posts SET guid = REPLACE(guid, 'http://www.old-domain.com','http://www.new-domain.com');

    /**

    If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

    **/

    UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
share|improve this answer
add comment

Any fields that aren't standard (csv_post, csv_post_title etc. see the example/faq for the full list) will get imported as a post_meta key.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.