WPML Compatible WP Ultimate Recipe to WP Recipe Maker Migration Script

The importer script supplied with WP Recipe Maker to convert WP Ultimate Recipe posts into WP Recipe Maker recipes does not work with multilingual posts managed with WPML. The importer works properly for posts written in the default site language but does not work for posts written in other languages used by the site.

The WP Recipe Maker importer fails in a WPML site because the supplied import script converts the WP Ultimate Recipe posts into regular post types before the importer runs. This recipe post type conversion only happens for posts written in the default language of the site. After posts written in the default language are converted to WP Recipe Maker recipe cards the importer is no longer able to work with posts written in a site’s other languages.

If you have 100 recipe posts in English [default language] and 100 recipe posts in Spanish [alternate language] the importer will convert the English recipe posts to regular post types before it converts the recipe meta in the post into a WP Recipe Maker recipe card and shortcode. The Spanish WP Ultimate Recipe posts are not translated and the site can no longer manage the Spanish recipe posts.

How to Recover Those Recipes

You have two options:

  1. Restore a database backup then disable WPML and rerun the WP Ultimate Recipe Maker importer script. This may or may not work badly.
  2. Do not restore a database backup. Use the alternate WPML compatible recipe importer script shown below here.

You can skip the rest of this post if option 1 worked for you.

An Alternate Recipe Importer Script

This guide shows you how to convert WP Ultimate Recipe posts into WP Recipe Maker recipe cards in WPML site.

For future reference, the fix so far has been to:

Move the recipes rendered invisible by the importer. To do this,

Create a database backup

Use a backup plugin like Updraft Plus or download a database backup in cPanel by going to Backup > Download a MySQL Database Backup and clicking the name of the database to download.

Install the WPML compatible recipe importer script

Replace the WP Ultimate Recipe to WP Recipe Maker import script code with the script code shown further down in this post.

Use the plugin editor by going to

  • WP Dashbaord > Plugins > Editor
  • Select WP Recipe Maker using the file selector on the top right of the plugin editor screen
  • Choose Includes > Admin > Import > class-wprm-import-wpultimaterecipe.php
  • Select all the code in the file
  • Replace the code with the custom WP Ultimate Recipe Maker import script shown below here.
  • Save the new custom import script

Alternatively, if the plugin editor is disabled, login to cPanel and use the file manager (or use an FTP program) to edit the file found at wp-content/plugins/wp-recipe-maker/includes/admin/import/class-wprm-import-wpultimaterecipe.php.

Install Post Type Switcher

Install Post Type Switcher from the WordPress repository. Go to

  • WP Dashboard > Plugins > Add New
  • Search for Post Type Switcher
  • Install and activate the plugin

Disable WPML

Disable WPML to make the hidden WP Ultimate Recipe posts visible

Switch Post Types

Switch the recipe post type to regular post type.

  • View the WP Ultimate Recipe Maker posts list page at WP Dashboard > Recipes. The recipe posts will show now that WPML is disabled.
  • Select all the recipe posts
  • Click Quick Edit
  • Switch the post type to just plain old ‘post’

Because WPML is disabled the WP Ultimate Recipe ‘recipe’ posts will become regular posts in the default site language. Their post language version associations are maintained and will each post will restore to its proper site language version when WPML is reactivated. If the WP Ultimate Recipe posts were written in Spanish, when WPML is reactivated they will be restored to the Spanish version of the site as regular posts.

Run the recipe importer script

Convert the old recipe posts into WP Recipe Maker recipe cards.

  • Go to WP Dashbaord > WP Recipe Maker > Import Posts
  • Run the available importers. One of these Importers will be the new WP Ultimate Recipe Maker importer.

The recipe information in a WP Ultimate Recipe post is stored in each recipe post’s meta fields. This recipe data is preserved when the WP Ultimate Recipe post type is switched to the standard WordPress post type.

The import script converts any WPUR recipe meta data found in a post into a WPRM recipe card post type. The script only converts the meta data into a new recipe card if a shortcode for a WP Ultimate Recipe recipe card is found within a post. Any WP Ultimate Recipe shortcode found in a post is converted to a WP Recipe Maker shortcode. This prevents recipes being imported multiple times.

Activate WPML

Reload the recipe importer page to confirm all recipes have been imported and reactivate WPML when the recipe import is complete.

When WPML is reactivated all posts will restore to their proper language version of the site.

The Custom WP Ultimate Recipe Importer Script

This custom import script replaces the file found at wp-content/plugins/wp-recipe-maker/includes/admin/import/class-wprm-import-wpultimaterecipe.php.

Replace the full contents of class-wprm-import-wpultimaterecipe.php with the custom code.

That’s it!

There you have it. A lot of words just to say replace the official WP Ultimate Recipe importer script with the custom importer code found above, disable WPML, switch the recipe post type to regular post type, run the importer and reactivate WPML.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of

Free to your inbox

Join our mailing list to receive the latest news and updates from JournalXtra.

You have Successfully Subscribed!