Jetpack
Support Home > Utilities > WP.me Shortlinks

WP.me Shortlinks

Shortlinks are a quick way to get short and simple links to your posts and pages. They use the wp.me domain so you can have more space to write on social media sites.

To use shortlinks make sure the “WP.me Shortlinks” module is enabled from the Jetpack tab in your Dashboard.

Using shortlinks

These are perfect for use on Twitter, Facebook, and over SMS where every character counts.

  1. Go to Posts > Add New. You can also edit an existing post or page.
  2. Directly under the title field, next to the post/page permalink, you will see the “Get Shortlink” button.
    get-shortlink
  3. Click “Get Shortlink” A dialog box will appear with the post or page’s shortened URL.wpme-shortlink
  4. Copy the shortlink and distribute it as you wish.

The functionality for these shortlinks is similar to other URL shortening services. WP.me is different, though, in a few ways:

  • Every post on WordPress.com and Jetpack-powered blogs has a WP.me URL.
  • These are all exposed in the <head> using rel=shortlink.
  • It doesn’t work for any URL in the world, just WordPress-hosted ones.
  • The links are permanent, they will work as long as WordPress.com is around.
  • The WP.me domain is spam-free, because we are constantly monitoring and removing spam from WordPress.com.

Enable shortlinks for Custom Post Types

By default, WP.me shortlinks are generated for each one of your posts, pages, and attachment pages.

  1. You can add Shortlink support to an existing post type thanks to the add_post_type_support() function. To do so, add the following code to a functionality plugin:
    add_action('init', 'my_custom_init');
    function my_custom_init() {
        add_post_type_support( 'product', 'shortlinks' );
    }

    You’ll need to replace “product” by your Custom Post Type name.

  2. You can also add Shortlink support when registering the post type, like so:
    // Register Custom Post Type
    function custom_post_type() {
    
        $labels = array(
            'name'                => _x( 'Products', 'Post Type General Name', 'text_domain' ),
        );
        $args = array(
            'label'               => __( 'product', 'text_domain' ),
            'supports'            => array( 'title', 'editor', 'shortlinks' ),
        );
        register_post_type( 'product', $args );
    
    }
    // Hook into the 'init' action
    add_action( 'init', 'custom_post_type', 0 );
Follow

Get every new post delivered to your Inbox.

Join 54,480 other followers