WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the variable that holds the wp.me url? / What is the webservice / call that provides me the wp.me url? / What is the workaround to read that rel tag from the dynamic generator header (on a self hosted domain).

... to show it beneath each post.

share|improve this question
up vote 2 down vote accepted

WP 3.0 includes:


which returns the ?p=1 style url for any post within your domain. This can be filtered, however for other shortening services, which is what the Wordpress.com Stats plugin does for self-hosted blogs. With that plugin installed and activated, wp.me shortlinks will be output instead of the default mydomain.com/?p=1, and can be retrieved with the function which can be used within the loop as:

echo wp_get_shortlink()

or to retrieve any post outside the loop:

$link = wp_get_shortlink($post->ID);
share|improve this answer
I was not aware of the fact that the stats plugin offers wp.me shortlinks. – hakre Nov 9 '10 at 23:32
it's not exactly well-documented - I noticed it by accident ;-) – somatic Nov 9 '10 at 23:50

wp.me shortlinks are a feature of wordpress.com. The were introduced in this article: WP.me — shorten your links.

On a wordpress.com webblog you can make use of that feature. The button which reveals the shortlink gets it from the page source, the link is stored there within a hidden input element.

So I'm unaware how this should be possible to use on other sites then wordpress.com, sorry.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.