Get AI SEO for FREE.

Learn More!

How to Create a KML Sitemap Using Rank Math

Rank Math includes a feature to create a KML sitemap automatically for Local SEO, which makes it easier for Google to read and render the geographic data of your business location. So In this knowledgebase tutorial, we’ll walk you through how to create one using Rank Math.

How to Create a KML Sitemap using Rank Math

Note: This feature is only available in Rank Math PRO.

1 What is a KML File?

Keyhole Markup Language or KML is an XML-based format that is used for storing geographic data and rendering information that is easier to read. This technology was acquired by Google and subsequently submitted to the Open Geospatial Consortium further.

KML files have either a .kml or .kmz (for compressed or zipped KML files) file extension. KML includes both vector and raster elements such as points, lines, polygons, and imagery, as well as related content like graphics, pictures, attributes, and HTML.

KML is more than a way to store map coordinates. KML files are like HTML and only comprise links to icons and raster layers. 

2 What Are the Benefits of a KML File?

KML files display your business’s geographic details in such a way that it’s interoperable with other applications like Google Maps and Google Earth. Google verifies your business listing and location with the help of these KML files.

Not only this, but it also contains instructions for how to display the location, like marker color and style. You can also read more about KML in this KML documentation maintained by Google.

3 KML Files in Rank Math

Rank Math adds the KML file automatically when the Local SEO module is enabled. You can enable it from Rank Math SEO → Dashboard, as shown below:

Enable Local SEO module

Then navigate to Rank Math SEO → Titles & Meta → Local SEO and select Organization in order to view the geo-coordinates option.

Choose Organization for Local SEO settings

4 How to Add KML for Your Local Business?

At first, add geo-coordinates by navigating to WordPress Dashboard → Rank Math SEO → Titles & Meta → Local SEO. Please refer to this guide from Google on how to find your business location’s geocoordinates.

Geo-coordinates in Rank Math


You can also check our guide on how to setup Local SEO that will help you understand the Local SEO settings in detail. Once you have added the Geo Coordinates, please save your page and then check your KML.

Please note: If you fail to enter or enter incorrect geo-coordinates, a blank KML file will be created.

Here’s an example of a KML File:

KML file in Local sitemap

If Geo-Coordinates are missing, a blank KML file will be created. We update it with multiple location data, including Geo-Coordinates, when you use Multiple Locations CPT.

We’ll now show you how to add KML for multiple locations.

5 How to Add KML for Multiple Locations?

Add geo-coordinates by navigating to WordPress Dashboard → RM Locations. Edit the location and go to Rank Math’s Schema tab and click on Schema Generator as shown below:

Click on Schema Generator

In the Schema Generator that appears on the screen, click on Use against the Local Business Schema.

Use Local Business Schema

Add the Geo Coordinates in the Schema Builder and click on Save for this Post once you have made the changes. You can go through our guide on how to create multiple locations with the help of Rank Math if you are creating multiple locations for the very first time.

Geo-coordinates in Schema Builder

Once you’ve added the geo-coordinates, then you can check the KML, and you will see each location as shown below:

Locations listed in KML sitemap

6 Filter to Add Locations KML File in the Sitemap

With the help of the Rank Math SEO plugin, you can also make use of the below filter in order to add locations KML file in the Sitemap.

/**
 * Filter to add Locations KML file in the sitemap
 */
add_filter( 'rank_math/sitemap/locations', '__return_true' );

However, if you still have any queries, please feel free to contact our support team, and we’d be happy to help you at any given time.

Still not using Rank Math?

Setup takes less than 5 minutes including the import from your old SEO Plugin!

Learn more about the PRO Version

Still need help?

?

Submit Your Question

Please give us the details, our support team will get back to you.

Open Ticket

Related Articles