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
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.
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.
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.
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:
http://www.domainexample.com/recipes/cheeseburgers
http://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 http://www.domainexample.com/recipes/cheeseburgers one is still accessible but there will be a canonical meta tag set pointing to http://www.domainexample.com/cheeseburgers so search engines know that this is actually the same page and will send all traffic to http://www.domainexample.com/cheeseburgers
Every link on your website should point to http://www.domainexample.com/cheeseburgers as well, so I wouldn’t worry about it.
Brecht
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.