Support » Plugin: Shortlinks » [Plugin: Shortlinks] The plugin is creating two links per page

  • Thank you for this plugin, it’s excellent. There’s just a little bug I’ve noticed.

    When I create a post, even before I save it, the plugin generates a link to the /?p= url rather than the permalink, and saves it to my account. When I subsequently publish or title the post, the plugin generates a second link — this time to the permalink. As a result, my account has two links per page.

    Is there any way of preventing this?



Viewing 1 replies (of 1 total)
  • I was having a similar issue, where a permalink would be created before the post was published (or scheduled).
    Given that for some of my content the first title is just a draft, this was causing multiple links to be created.

    To solve the problem I slightly modified the plugin, putting the following code right at the beginning of the yoast_bitly_shortlink function:

    $mypost = get_page( $id );
      if ( !in_array($mypost->post_status, array('future', 'publish')) ) {
        return "Post must be published to get a shortlink";

    I don’t know if there is any reason why you’d need a shortcode earlier than that time, maybe Joost can include this patch in the next release of the plugin.

    [ Signature moderated. ]

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Shortlinks] The plugin is creating two links per page’ is closed to new replies.