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.

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 );
  • Categories

  • Contact Us

    Need more help? Feel free to contact us.
  • Follow

    Get every new post delivered to your Inbox.

    Join 56,545 other followers