If you have one single page that you need to stop Google indexing, this the following code is how you fulfil that task.
function add_noindex_to_locations_pages() {
if ( strpos( $_SERVER['REQUEST_URI'], '/category/locations/' ) !== false ) {
echo '';
}
}
add_action( 'wp_head', 'add_noindex_to_locations_pages' );











