Skip to content
Knowledge Base
Search in

Recipes Don't Have the Correct Parent Post

The Parent Post of a recipe is the post, page or custom post type that contains the recipe card inside of it. On the WP Recipe Maker > Manage page you can check the “Parent Name” column to see what our plugin recognizes as being the parent post of a particular recipe.

The parent post is used for several important features:

  • The plugin uses ratings from comments given to the parent post of the recipe
  • In the recipe metadata, links to the parent post are used for URL properties
  • In a grid or index, clicking on a recipe will take you to its parent post
  • Print access can depend on the parent post’s visibility and restrictions

When you save a post, WP Recipe Maker looks for recipes inside it and associates the post as their parent. To change the parent post, try saving what should be its parent.

You can also try using the Find Parent Posts button on the WP Recipe Maker > Tools page. Take note that you should probably disable “Automatically Lock First Parent Post” first, on the WP Recipe Maker > Settings > Post Type & Taxonomies page, otherwise it won’t change the currently associated parent post, since it’s locked in place.

My Recipe Status Does Not Match its Parent

Section titled “My Recipe Status Does Not Match its Parent”

A recipe’s status can be out of sync with its parent post. For example, the parent post may be published while the recipe is still a draft. If the assigned parent is correct, use Sync Parent Status on WP Recipe Maker > Tools to repair the status.

  1. Check the Parent Name column on WP Recipe Maker > Manage. Correct missing or wrong parents first using the steps above.
  2. Open WP Recipe Maker > Tools and click Sync Parent Status. This starts processing recipes; it is not a preview of proposed changes.
  3. Wait for processing to finish, then review the Detailed Report for updated, unchanged or skipped recipes.

The tool changes only the recipe’s status to match its assigned parent. It does not reassign parents or change recipe content or publication dates. It supports published, scheduled, draft and private parent posts. Recipes with no assigned parent, an invalid parent, or a parent that does not contain the recipe are skipped. It also skips recipes you cannot edit, unsupported parent statuses, and changes that would require altering the recipe’s publication date.

For skipped recipes, check the reason in the report. Find Parent Posts finds and assigns parents; Sync Parent Status uses the existing assignment. Running the status tool cannot repair a missing or incorrect parent on its own.

For printing issues, also check print permissions and public-post context. An unpublished recipe is not automatically unprintable: access depends on the print settings and the visitor’s access to the recipe and the post displaying it.

My Recipes Don’t Have a Parent Post at all

Section titled “My Recipes Don’t Have a Parent Post at all”

When saving a post, WP Recipe Maker looks inside the post content for any recipes inside of it. If our plugin cannot find a recipe in the post content, it will not be able to assign the parent post correctly. This can happen if you’re using a non-compatible page builder or if you are not storing recipes in the post content at all (for example storing recipes in custom fields instead).

If you need a non-common setup like this, it is possible to manually assign the parent post as well, but this would require custom development. You could use the save_post hook to check when a post is being saved and then manually set the wprm_parent_post_id meta for the recipe post type.

For example:

function wprm_check_for_parent_post_save( $post_id, $post ) {
// TODO, check if there is a recipe in the custom location you have saved it.
$recipe_id = false;
if ( $recipe_id ) {
// Set $post_id as the parent post for this $recipe_id.
update_post_meta( $recipe_id, 'wprm_parent_post_id', $post_id );
}
}
add_action( 'save_post', 'wprm_check_for_parent_post_save', 10, 2 );

Take note that you will probably also want to change the “Output Recipe Metadata” setting to “Next to recipe in HTML body element” on the WP Recipe Maker > Settings > Recipe Metadata page, as for outputting the metadata in the head, we also check for recipes in the post content.

So in general we highly recommend making sure the recipe shortcode is actually part of the post content, to ensure compatibility, but alternatives are possible with custom code.