1

I've a food recipe site which is running a custom PHP script.

I want to move my website to WordPress and I found a plugin called: Cooked which I think will help me.

Now, I want to transfer my recipes which are found in my old PHP script. But I've ran into some problems with SQL.

  1. First of all, I inserted my old table into wp_posts, but this didn't work.

    • Because the ingredients and recipe data have merged in post_content column. So I installed the plugin above.
  2. The Cooked plugin creates some meta keys in wp_postmeta plugin. I couldn't find a solution about inserting my recipe columns into it.

    • For example, here is my old recipe table: Original recipe table
    • And here is the wp_postmeta table: New table

I want to insert my columns which you can find them at first picture: id, prepare, malzeme, hikaye

Into the wp_postmeta rows: post_id, _cp_recipe_directions, _cp_recipe_ingredients, _cp_recipe_short_description.

Is this possible with an SQL command or just manually? Or are there any other ways to do this? Thanks.

  • Please provide a link to the plugin you are referring to – Ethan Jinks O'Sullivan Aug 21 '16 at 12:44
  • Sure: link @EthanJinksO'Sullivan – Katzenliebe Aug 21 '16 at 12:50
  • Did my answer resolve your question? If so, please upvote it and click the green checkmark to let the community know. Thanks. – Ethan Jinks O'Sullivan Aug 22 '16 at 17:40
0

To answer your questions:

Is this possible with an SQL command or just manually?

  1. Possibly. This would require you to map the data from your old table to the new WordPress table, since your old custom PHP script won't be on WordPress. Merging your data from your old recipe table into WordPress won't work since it is a completely new platform that you are migrating to and doing so will mess up your WordPress website.

Or are there any other ways to do this?

  1. A few ways:
    • Manual: If you don't have that many recipes, you can manually copy-and-paste the data into your new WordPress website and plugin (Cooked). While this may be a tedious process, it's a clean way.
    • Automated: Export the data from your old recipe table into an XML or CVS file and have that imported to WordPress. You can use a plugin that imports the XML/CSV (such as this one) by mapping the data to your new table and rows. I've personally haven't use the plugin that I just linked to you, but it will require some testing on your end.
    • Professional: If the above are too tedious for you and you're not comfortable with your technical skills, I'd look into hiring a WordPress professional who can help you with the migration process. This would cost you, unless you're willing to pay. Prices vary on each web developer. You can post your job listing here.
  • Hello again, i've 6500 recipes and the manual way is too hard for me. Your automated version is logical but i've 2 different row in my old php database. Ingredients and directions. So i want to export them separately and import to _cp_recipe_directions and _cp_recipe_ingredients. If it is not possible for example i may export only the row which is called malzeme, not all the table. Is it possible? If it is yes how can we do that? @EthanJinksO'Sullivan – Katzenliebe Aug 24 '16 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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