Title: Detect a WordPress.com site in the plugin code
Last modified: June 6, 2017

---

# Detect a WordPress.com site in the plugin code

 *  [makfruit](https://wordpress.org/support/users/makfruit/)
 * (@makfruit)
 * [9 years ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/)
 * Hi,
 * Wordpress.com recently allowed their users to install all plugins from the WordPress.
   org plugin directory. This is great — plugins can now be available for a broader
   auditory.
 * Question: is there a way a plugin developer can tell a site is running on WP.
   com or WP.org? I mean detecting that in the plugin code. Is there any WordPress
   API or some “unofficial” way to tell one platform from another from inside the
   plugin?
 * The Codex pages don’t provide any tips on that, as far as I can see ([https://codex.wordpress.org/WordPress_vs_WordPress.com](https://codex.wordpress.org/WordPress_vs_WordPress.com)).
 * Thanks,

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/#post-9201762)
 * To spot a self-hosted site you can generally look for the “version” (referring
   to WordPress core version).
 *  Thread Starter [makfruit](https://wordpress.org/support/users/makfruit/)
 * (@makfruit)
 * [9 years ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/#post-9205362)
 * Thanks Andrew. So, a WordPress self-hosted site will have something like “4.7.5”
   in the version field. What about a wordpress.com cloud-hosted site — what will
   it have there?
 *  Thread Starter [makfruit](https://wordpress.org/support/users/makfruit/)
 * (@makfruit)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/#post-9274332)
 * Hi [@anevins](https://wordpress.org/support/users/anevins/),
 * Can you help?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [8 years, 11 months ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/#post-9274340)
 * It’s probably easier to use a website like [http://whatwpthemeisthat.com/](http://whatwpthemeisthat.com/)
 *  Thread Starter [makfruit](https://wordpress.org/support/users/makfruit/)
 * (@makfruit)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/#post-9275084)
 * Thanks for the link. I tried it — it seems to not “understand” WordPress.com 
   sites at all. Also, how will it help to detect the platform from within the plugin
   code?
 * Thanks,
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/#post-9275327)
 * You could try [https://builtwith.com/](https://builtwith.com/), of course that
   doesn’t help a plugin’s code figure this out either, unless there is some sort
   of API it can tap into. It could at least help with corroborating some other 
   technique you are testing. I’m not convinced there is any dead giveaway in site
   content. I’ve seen .com sites with the WordPress 4.8 generator tag. .org sites
   with Jetpack will have .com references. If you get the IP address for a domain(
   DNS A record) and do a whois for the IP, it should come back owned by Automattic.
   I’ve not done this enough to be sure this is reliable. Certainly not reliable
   in the case of any sort of domain forwarding scheme external to wordpress.com.
 * I think at best it’s an educated guess if you are limited to publicly accessible
   data. There may be a clue in the PHP $_SERVER data. Your plugin can collect this
   info, but you cannot have the data sent to you for analysis unless the user specifically
   opts in.
 *  Thread Starter [makfruit](https://wordpress.org/support/users/makfruit/)
 * (@makfruit)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/#post-9277906)
 * Got it, thank you!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Detect a WordPress.com site in the plugin code’ is closed to new replies.

## Tags

 * [wordpress.com](https://wordpress.org/support/topic-tag/wordpress-com/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 7 replies
 * 3 participants
 * Last reply from: [makfruit](https://wordpress.org/support/users/makfruit/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/detect-a-wordpress-com-site-in-the-plugin-code/#post-9277906)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
