Hi I have used some code to make the changes successfully, excluding specific categories. It direct to the home page if user is trying to access any portfolio archive.
However, it blocks me on wordpress backend to access any of my portfolio entries, I can’t edit or access a list at all, it will redirect me to home page.
The second issue is that the entire shop is blocked too.
Could I ask for a proper solution to keep all portfolio entries and archives non searchable by crawlers?
This is the code I have used in functions.php
function redirect_to_home( $query ){
if(is_archive() ) {
wp_redirect( home_url() );
exit;
}
}
add_action( 'parse_query', 'redirect_to_home' );
My website is: https://idophotographydungarvan.ie
Thank you for your help.