• Resolved ajowen88

    (@ajowen88)


    Hi,

    I have a site that has recipes on it. When I transitioned to this plugin, I made the recipes in the plugin and then used the short code in my original posts (replaced all of my original content). It looks great!

    My issue is that when the search function is used, both the original post and the recipe post show up in search results. I want ONLY the original post to show up.

    Any way to remedy this? I have tried “Remove recipe slug” and “Recipes act as posts” to no avail.

    Thank you!

    https://www.ads-software.com/plugins/wp-ultimate-recipe/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Brecht

    (@brechtvds)

    Hi there,

    Is there a reason for including the recipes with the shortcode instead of adding your post content to the recipe itself? That would actually be preferable for SEO reasons.

    Kind regards,
    Brecht

    Thread Starter ajowen88

    (@ajowen88)

    We did it this way to keep the original URL’s. If I moved the post content to the plugin recipes, you are saying that would help SEO?

    Plugin Author Brecht

    (@brechtvds)

    The problem is that you have two pages for the same content like this: one that contains the recipe only and one with the post and the recipe both. So the SEO juice will basically be split across these two pages.

    I’d move the post content to the recipe, remove the original post and make sure that your recipe has the same permalink as your original post (you’ll probably have to remove the recipe slug).

    But if you’d like to keep your current structure I can look into it in about 30 minutes. I’m currently on mobile.

    Plugin Author Brecht

    (@brechtvds)

    If you want to keep your current structure and don’t want the recipes in the search results: could you try disabling both “Recipes act as Posts” and “Show Recipes in Archives”?

    The first one is one the Advanced page, the second on the Recipe Tags one.

    Thread Starter ajowen88

    (@ajowen88)

    Thanks for the replies!

    Unfortunately, that didn’t do the trick ??

    Plugin Author Brecht

    (@brechtvds)

    Could you try adding the following code to your theme’s functions.php file:

    function wpurp_no_recipes_in_search( $query ) {
    	if( $query->is_search ) {
    		$query->set( 'post_type', array( 'post', 'page' ) );
    	}
    
    	return $query;
    }
    add_action( 'pre_get_posts', 'wpurp_no_recipes_in_search' );

    This will ensure that only posts and pages show up in the search results. If you only want posts, you can remove the page here as well. Or add other custom post types that you want to show up.

    Thread Starter ajowen88

    (@ajowen88)

    That code is a huge help, thank you!

    One question — would that make them hidden from google and not linked to from any other indexable (viewable by google) part of the site?

    Plugin Author Brecht

    (@brechtvds)

    It won’t hide them from Google, just for visitors using the search function. That is why I actually recommend moving all the content to the recipes themselves.

    Thread Starter ajowen88

    (@ajowen88)

    Hi again!

    I moved all of the posts over and that definitely helped. I have one last issue now. All of my recipes link to two different URL’s and I need to get rid of one.

    For example:

    https://www.domainexample.com/recipes/cheeseburgers
    https://www.domainexample.com/cheeseburgers

    These both link to the same page. How can I rid of one?

    Thank you again!

    Plugin Author Brecht

    (@brechtvds)

    The https://www.domainexample.com/recipes/cheeseburgers one is still accessible but there will be a canonical meta tag set pointing to https://www.domainexample.com/cheeseburgers so search engines know that this is actually the same page and will send all traffic to https://www.domainexample.com/cheeseburgers

    Every link on your website should point to https://www.domainexample.com/cheeseburgers as well, so I wouldn’t worry about it.

    Brecht

    danielpcc

    (@danielpcc)

    Hi the solution I found is to create the recipes as private posts and so add them into the old posts. In this way, I maintain the old posts with the new reciped plugin.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Duplicate Posts’ is closed to new replies.