Drag the following link to your favorites, bookmark toolbar, etc.
Source code:
var is_wordpress = "This site does NOT seem to be powered by WordPress."; $("link[rel='stylesheet']").each(function(){ if ( -1 != $(this).attr("href").indexOf("wp-content") ) { is_wordpress = "This site IS powered by WordPress. Woo hoo!"; return true; } }); alert( is_wordpress );
Combined with the jQuery bookmarklet boilerplate which auto-loads jQuery if the site in question hasn’t loaded it already. Yes I’m lazy and used jQuery. Sue me. 😛
That’s cool. Another way might be to look at the meta tag named generator.
I thought about that but some people use plugins that hide/change that thinking security through obscurity is a good thing. I think my method is more reliable as it’s very rare to come across a site that doesn’t make use of their
style.css
or some other CSS file located in theirwp-content
folder.The only problem with the wp-content method is that users can, and sometimes do, change their wp-content directory. So it’s dependent on them having a default installation (which is usually the case).
The meta/generator works, but as you pointed out sometimes plugins disable it, and if a theme is missing wp_head(), then it also wouldn’t work (also the site would probably be pretty broken at that point).
But it’s a fun little exercise! I’ve often viewed source on a site to see if they were running WordPress, so your little bookmarklet is a cool idea.
Pingback: WordPress Community Links: Mobile townhall edition | WPCandy