Support » Plugin: Basic Google Maps Placemarks » Mass import of Placemarks with proper Categories

  • miquelpontes



    I’m using Basic Google Maps Placemarks to represent wildlife sightings on several maps. The problem is I have over 200 wildlife species with no less than 10 sightings each, so I’m forced to consider a mass import option. In case you’re curious, the web site is

    I have checked the forum and seen a CSV import plugin solution, but this procedure ignores Categories, while I intend to name one category for each wildlife species, and label the sighting record to every species. CSV import is not enough for me.

    Then I recalled a similar problem with several hundreds of external website reference links (for the same website) that solved nicely with the “Import blogroll with categories” plugin, a simple code that parses an OPML file (a kind of XML file that differentiates Categories and Links) and feeds the internal WP tables just fine… but for Blogroll links and their categories only.

    My question is, wouldn’t be possible to modify the “Import Blogroll with Categories” and produce a kind of “Import Placemarks with Categories” plugin?

    I’m not a PHP programmer, but studying the code of that plugin I have seen that relationships among the tables wp_terms, wp_term_taxonomy and wp_term_relationships (these three tables hold the categories) is exactly the same for placemarks as for blogroll links (but for the category slug, that is “bgmp-category” instead of “link_category”), and the main difference is that blogroll links are fed into the wp_links table, while Placemarks are fed into wp_posts table.

    That modification I’m suggesting (a kind of fork of the blogroll importer) should be pretty trivial to an experienced programmer, despite being like black magic to me.

    Any help or suggestion would be greatly appreciated. Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Whilst this doesn’t exactly answer your question it might be of use to others looking at mass import options and perhaps you if you find no other solution. I could find no way to assign categories in the data. But I could add an id to the html which enabled them to be marked up in 20’s which saved a lot of time…

    Just thought I’d share my experience uploading and managing mass uploads of placemarks with lots of categories just in case anyone else is assigned the fun challenge of uploading thousands of them and wishes to keep things as simple as possible.
    This is an extension of an earlier post I found very useful but with a couple of changes so that you can also assign featured images (placemark icons) in the data and assign categories quicker manually (there’s no way I could find to do this by including it in the data). It’s not ideal but the best we could manage with our level of skill and this plugin. Okay, let’s begin:

    It’s a six step process.
    1) In order for your maps to load quickly you should think about categories for your placemarks carefully. Basically you only want to load what you need by calling categories in the shortcode. Hundreds of placemarks are okay. Thousands are a problem.
    To speed up assigning categories manually later on we included a unique identifier for each category in the HTML in column csv_post_post (see below). We wrapped the identifier(s) in a div with a class and then added display:none to that class in CSS (so it isn’t visible). You don’t need to do this but it made our lives easier because of the number of placemarks and categories we had.

    2) Format Data – Your placemark data needs to be in CSV format (use excel, comma delimited) with the following column titles:
    csv_post_title – in this column you put your placemark title
    bgmp_address – in this column put coordinates or fuzzy address
    csv_post_post – here you put the text/html for placemark
    csv_post_type – enter “bgmp” for all cells (no quotation marks)
    csv_attachment_thumbnail – enter the URL for the map-marker image (what will be featured image)

    You will need to split the file if it’s large to maximum of around five hundred markers in each. Remember to save each one as CSV and include the column headings exactly as they are above or else it won’t work.

    3) Get the right plugin – you need to download the forked version of CSV Importer plugin at GitHub and then upload it to WP/activate it.

    4) Upload Data – upload your data file(s) by going to TOOLS then CSV IMPORTER. Tick import posts as drafts. Select the first file and upload. Repeat until all data is uploaded as drafts. If you don’t import them as drafts at this stage you will get into a mess later on.

    5) You should now have all your hundreds or thousands of map markers as drafts with no categories assigned. You assign categories manually in batches of twenty. You do this by selecting all DRAFTS and then searching by your first category ID set in stage 1. The search will return however many there are in the data set containing that ID. Select all twenty on the first page with the tick box at the top. Then select EDIT from BULK ACTIONS and then APPLY. You can then assign the correct category to the twenty selected placemarks and hit UPDATE. Move onto the next page and repeat until all done. Then do the next category etc.
    If you didn’t assign category ID’s in the HTML then you will need to assign categories manually one at a time. Enjoy that one. Probably easiest to do this when you do the final step.

    6) You should now have all map markers as drafts with categories assigned. Now you need to publish each one individually (unfortunately). Open it and hit publish. I do twenty right clicks, opening them as new tabs. Using BULK ACTIONS and changing the status to PUBLISHED for twenty doesn’t work as the addresses don’t get geocoded. Nor does the QUICK EDIT select PUBLISH. In both these cases the post will be published but it will not be visible on maps and then you will be in a mess. You need to physically open each one and hit publish for the address to geocode.

    That should save you a lot of time.

    And please, if anyone finds a way to assign categories in the CSV file, let us know.



    Hi jdmedia, thanks a lot for the proposed solution. However, this was not exactly what I needed, and I see it is very complicated to implement.

    In the meantime, I searched for other solutions to georeference wildlife sightings in WordPress, and found a plugin called FLEXIBLE MAP, that allows me to put a lot of sightings coordinates in a KML file (about 200 or 250 coordinates is what I determined to run best), then reference this file from every WordPress post as a plugin shortcode parameter and “voilà”, our sigthings geocodes are now on the map, each one correctly identified and labelled, even on the map.

    Thank you very much for your time, work and efforts. Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Mass import of Placemarks with proper Categories’ is closed to new replies.