[resolved] Url given to Twitter (9 posts)

  1. msebald
    Posted 3 years ago #

    As a new user of Social (I upgraded the Twitter Tools plugin which now uses Social) I noticed that Social has some effects that Twitter Tools did not have when posting new articles to Twitter.

    For example the link sent to Twitter looks like this http://www.domain.tld/?p=106 instead of http://www.domain.tld/2012/10/15/article (which in my case is the url scheme given in WordPress config).

    Also I do not have any chance to set an url shortener like bit.ly or an own URL shortener like YOURLS. Twitter Tools had some extra plugins for this.

    Will the first issue be resolved and what about the second issue, which is more like a feature request?



  2. the_tim
    Posted 3 years ago #

    This was bugging me as well. I was able to tweak the plugin to change this manually. It was easy enough. Just do a find and replace of all instances of wp_get_shortlink with get_permalink.

    I found five that needed to be replaced:

    Search "wp_get_shortlink" (5 hits in 3 files)
      \wp-content\plugins\social\lib\social\controller\aggregation.php (1 hits)
    	Line 38: 		$url = wp_get_shortlink($post->ID);
      \wp-content\plugins\social\lib\social\service.php (2 hits)
    	Line 386: 					$url = wp_get_shortlink($post->ID);
    	Line 462: 					$url = wp_get_shortlink($comment->comment_post_ID);
      \wp-content\plugins\social\social.php (2 hits)
    	Line 140: 			$url = wp_get_shortlink($post->ID);
    	Line 1121: 			$shortlink = wp_get_shortlink($post_id);

    There were also two instances in the README.txt file but those can be ignored.

    The only problem is when you do this it will truncate the other content in your Tweet, e.g. https://twitter.com/SeattleBubble/status/257904154129874944

  3. the_tim
    Posted 3 years ago #

    Another option I found (which is probably what I'll be using) is to install this Goo.gl plugin, which replaces the output of wp_get_shortlink with a Goo.gl URL, and adds a nifty little stats tracking link right to your posts admin page.

  4. msebald
    Posted 3 years ago #

    Hi Tim,

    thank you for this hack/fix, which I already implemented. Sure the tweet will be truncated if too long, but normally I only post the article title, which should fit into the tweet also with the longer URL.

    Would this fix not be a good thing to put into the plugin, to chosse between shortlink and permalink?


  5. chinasmack
    Posted 3 years ago #

    We came on here about this issue as well. We'd prefer not to hack the plugin itself and we don't want our post titles to be truncated in our tweets so we might try to the goo.gl plugin.


    Do you know if the goo.gl shortlink resolves to the post's actual pretty permalink?

    If we have WP.me shortlinks turned on in Jetpack, Social will send a wp.me shortlink that goes to a t.co shortlink that finally resolves as a http://www.yourblog.com/?p=### link.

    If we turn off WP.me shortlinks in Jetpack, Scial will send the http://www.yourblog.com/?p=### link, which I think Twitter will shorten as a t.co link, but eventually resolves as the http://www.yourblog.com/?p=### URL.

    Thanks for your help.

  6. Alex King
    Plugin Contributor

    Posted 3 years ago #

    Please read the documentation...


  7. SoItsComeToThis
    Posted 3 years ago #


    I think many people are asking for native Bit.ly support. Is this something we can expect in the future? I'm hopeful Social will handle this instead of yet another plugin and some coding - which I consider no different than the hacks presented above.

    Hopefully bit.ly support will be re-introduced in a future version.

  8. Alex King
    Plugin Contributor

    Posted 3 years ago #

    Bit.ly has a WP plugin, why should Social or Twitter Tools duplicate that code?

  9. nardiphoto
    Posted 3 years ago #

    I use Bitly with a custom URL. If you use the Woo Dojo plugin, enable the Short Link option, which will generates short URLs for your posts, using your URL shortening service of choice - either Bit.ly or Tiny url - not sure about the others.

    When posts are broadcast with Social, links are automatically shortened with the bit.ly custom url

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Social
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic