Wordpress SEO Expert

Improve your Google ranking with 24-year experienced SEO professional Peter Mahoney

  • SEO Overhaul
  • SEO Campaign
  • WP Support
  • Blog
    • SEO Emails
  • Praise

Make a “Share on Twitter” link with URL and Hashtags

February 19, 2013 by Peter Mahoney

Make a "Share on Twitter" link with URL and Hashtags Wordpress SEO ExpertThis is a little coding trick I get asked about quite a bit.

The link you have to make to share something to Twitter is quite simple:

http://twitter.com/share?text=text goes here

But getting a URL and hastag in there is a different matter. To be honest most developers do know how to include the URL, but hashtags have proved more elusive!

http://twitter.com/share?text=text goes here&url=http://url goes here&hashtags=hashtag1,hashtag2,hashtag3

Here’s an example to try out:

http://twitter.com/share?text=Here’s an awesome tip!&url=https://peter.mahoneywebmarketing.com/make-a-share-on-twitter-link-with-url-and-hashtags/&hashtags=peter,is,awesome

And that’s it!

Filed Under: Code, Nerd-stream Tagged With: hashtagnerdy, hastags, linking to twitter with hashtags, Twitter, url

Comments

  1. Mark says

    March 21, 2014 at 5:02 pm

    Just what I was looking for. Thanks!

  2. Nails Salon says

    April 25, 2014 at 4:03 pm

    Greetings! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My web site looks weird when viewing from my iphone4. I’m
    trying to find a theme or plugin that might be able to
    resolve this problem. If you have any recommendations, please share.
    With thanks!

    • Peter Mahoney says

      September 4, 2014 at 12:40 pm

      I sure do!

      Forget plugins, ideally you want responsive CSS so the same site delivers the appropriate layout to any device.

  3. Angela says

    September 18, 2014 at 10:34 pm

    Thanks so much! This was just what I was looking for 🙂

  4. Nik Phirke says

    February 24, 2015 at 5:07 pm

    Perfect! Exactly the tweet link I wanted.

  5. Harrison says

    September 1, 2015 at 7:11 am

    The Twitter share code works perfectly.

  6. Oliver says

    October 27, 2015 at 8:41 am

    thanks a lot. Exactly what is was looking for. Twitter Share Code worked Properly.

  7. Nick Hill says

    September 28, 2016 at 8:15 am

    Hey man,

    Do you happen to know a way to share shortlinks this way? The URL does not show up in the tweet when you don’t add a HTTP/HTTPS.

    Best,

    Nick

  8. Aprisa says

    September 12, 2017 at 4:53 am

    Short and sweet! Just what I need. Thanks!

  9. Prashant says

    September 26, 2017 at 12:04 pm

    Your code is working perfectly but do you have any idea why my site’s logo is not appearing in the tweet, it is displaying default images instead of the site logo in the tweet.

    • Peter Mahoney says

      November 6, 2017 at 10:17 pm

      It’ll grab whatever the default image is on your page. Ideally you’d use Twitter card meta tags to set that sort of thing to whatever you prefer it to be.

Get FREE Wordpress SEO tips!

I send regular newsletters with WordPress SEO expert-level tips. Sign up to get them, along with my FREE e-book “Ongoing SEO Success”.

Did I mention they’re free!

Subscribe for free

Praise

I have over 2,500 5-star feedback reviews (and I’ve never received less than the full five.)

Here’s just one example, from Mike who runs Costello Entertainments:

Migration, Hosting, SEO and Speed Work on our new website all completed quickly and efficiently and Peter was most helpful in fixing an issue with a Popover on the site as well. If you’re thinking about asking Peter to do a job for you or hesitating, JUST DO IT! – He knows programming and the internet inside out, he’ll get the job done for you professionally, with a smile. I wish I could call a plumber or a tradesman to do the jobs I can’t do myself with the same level of confidence.
Read a lot more.

Recent Blogs

  • Thanks WordPress SEO expert for all your work.
    I feel like you are my guy for all my SEO. I did want to ask you if I need to get someone to write my Blog ...
  • Can the description show the Product Short Description
    Hi Peter SEO Expert :), Hope you’re doing well and having a good summer. Had this message from a client ...
  • Don’t just search for yourself!
    This is actually a stock answer I send people pretty often. I’m regularly asked about the difference ...
  • SEO doesn’t shouldn’t your site’s front-end
    On my SEO Emails section (where I share helpful responses to commonly asked queries) I recently shared a not ...

Legal

  • Terms and conditions
  • Privacy policy
  • Disclaimer

Also read

  • Payment information

RSS

Peter Mahoney, WordPress SEO expert blog

Recent Posts

  • Thanks WordPress SEO expert for all your work.
  • Can the description show the Product Short Description
  • Don’t just search for yourself!
  • SEO doesn’t shouldn’t your site’s front-end
  • Cumulative Layout Shift (CLS) for SEO & Speed

© Copyright 2023 Wordpress SEO Expert · All Rights Reserved · Site by Peter Mahoney