We have a requirement to specify an IP address on a post

Hi. We have a requirement to specify an IP address on a post we publish. We then wish to use a plugin like:


to show (and nicely cluster), the IP addresses assigned to each post. The nice thing about the "basic-google-maps-placemarks" plugin is it allows the placemark to refer back to a weblink to the post.

So there's two requirements:

1. tag or enable a custom field on a post, to enter an IP address (or maybe enter two IP addresses)

2. map those IP addresses on a world map

Why we need this?

We report various spams, malware and scams filtered on MailShark. For each of our posts which report publicly on caught spam, we want to assign the source IP of the spam (where it came from) and then show it on a map.

Over time, this would prove valuable to people to know which countries produce the most spam, and the type of spam by referring back to our posts.

We haven't gone through all the WPMUDEV plugins available to us, but if you could advise how we can achieve the above with one of your plugins (we've paid for all of them) it would really help us meeting this goal.

Thank you.

  • Michael

    Hi Madivad. Thanks for replying so quickly.

    All our posts are original and represent just reports of the most common spam caught by our Email filters.

    We get the IP from our Email filtering system by analysing Message Headers. We just manually get that IP and wish to manually add it to the post.

    I guess this is where you can assist, on the above as to how to do it properly.

    Step 2 would be to just reference that IP as a placemark on a Google map (suburb / city is sufficient as a Maxmind IP database would give which IP is related to which city/suburb).

    Hope this makes sense as to what we're hoping to achieve?

  • madivad

    Makes perfect sense :slight_smile:

    Adding it manually to the post is the easiest part. In the post towards the bottom is a custom fields section (if it's not, go to the screen options at the very top and click on it, then enable custom fields).

    In the custom fields section, add a new custom field and call it whatever you like, I suggest something more than just "ip", maybe your {website abbreviation}_spam_ip. It can be anything you like, just avoid possible clashes with other possible custom fields created by other plugins. ("ip" or "spam_ip" or "bad_ip" by themselves aren't reserved or used by the system, and so you could use anyone of them if you wish).

    With regards to point 2, give me a chance to checkout that plugin, and I'll get back to you if no one else does in the meantime. But I would guess you could add a description field, or the display field of the location tag itself (although a hover tag would probably be better).

    I personally wouldn't think the IP address being visible on the map would be so important. I'd just have that as data under it or in another post/area altogether. It would make the map very busy, especially when you get several hits from the EU, Russia or China

  • madivad

    What do you actually want to do with the IP address on the map?

    I have just added that plugin and created a page with pseudo data, anything that appears in the Placemark CPT Title, appears as a hover text on the placemark. This is quite neat.

    Your workflow would be:

    * Create your post and create the custom field with the ip address
    * Create your placemark (with your suggested plugin), putting the ip in the title field of the Placemark CPT

    I would take it a step further and automate the process. Instead of actually creating the post manually, use one of the many form to post plugins, and create a form that takes all your data and creates the required placemarks CPT. You don't need to worry about an actual post* because you only need to display the map shortcode on one page.

    *unless you wanted to of course.

    I know my answer has been more workflow than technical, so let me know if there's anything I'm missing and you'd like more help with.

  • Sajid

    Hi @Michael

    Hope you are doing good today :slight_smile:

    @madivad laid out the steps and workflow very nicely. In technical point of view you have to customize the plugin to fetch the IP of the post and display on map.

    I have not used that plugin yet so I am not sure how to do that exactly. If you contact your developer to check if there are any filters hooks that we can use to inject the IP in map dynamically without editing the core files.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.