Google Crawl Price
-
Hi,
What is the code snippet to add so google can always crawl prices only in USD, this is affecting merchant center, i see in some other plugins, you can add custom code to allow google bot to crawl prices in USD only.
This would be helpful to avoid issues in merchant center, and also this would be avoid the need to add custom parameters to the url.
Hoping for some results.
Here is something i found, kindly check and check if this would work?
`function wpbc_visitor_is_bot() {
$user_agent = isset($_SERVER[‘HTTP_USER_AGENT’]) ? $_SERVER[‘HTTP_USER_AGENT’] : null;
$bot_types = ‘bot|crawl|slurp|spider’;return !empty($user_agent) ? preg_match(“/$bot_types/”, $user_agent) > 0 : false;
}function set_currency_for_bots() {
// Only change the currency for bots, and only on the frontend
if(wpbc_visitor_is_bot() && (!is_admin() || defined(‘DOING_AJAX’))) {
// Always force selected currency to US Dollars. Bots will always see prices
$_POST[‘wcpbc_currency_switcher’] = ‘USD’;
}
}
add_action(‘woocommerce_init’, ‘set_currency_for_bots’, 0);The page I need help with: [log in to see the link]
- The topic ‘Google Crawl Price’ is closed to new replies.