Geo Meta Tags for Local Businesses
Adds geo.region, geo.placename, geo.position and ICBM meta tags with your business location to every page, a small extra local signal for some search engines and directories.
Opens WPIDE on
Code
// Your location.
$wpide_geo = array(
'region' => 'US-IL',
'placename' => 'Springfield',
'latitude' => '39.7817',
'longitude' => '-89.6501',
);
printf(
'<meta name="geo.region" content="%1$s">' . "\n" . '<meta name="geo.placename" content="%2$s">' . "\n" . '<meta name="geo.position" content="%3$s;%4$s">' . "\n" . '<meta name="ICBM" content="%3$s, %4$s">' . "\n",
esc_attr( $wpide_geo['region'] ),
esc_attr( $wpide_geo['placename'] ),
esc_attr( (float) $wpide_geo['latitude'] ),
esc_attr( (float) $wpide_geo['longitude'] )
);
Notes
Region uses the ISO 3166-2 code (country-state), e.g. US-IL or GB-LND. Find coordinates by right-clicking the spot in Google Maps.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.