Skip to content

Share buttons

How to add social share buttons to WordPress

By Hannah Voss, Editor · Reviewed September 2026 · 4 min read

Quick answer

There are three ways to add share buttons to WordPress: a sharing plugin, a block or pattern that outputs plain share links, or a few lines in your child theme. Pick the lightest option that gives you the networks your readers use, place the buttons at the end of posts first, and only add share counts if you can keep them accurate.

On this page
  1. Choose one of three approaches
  2. Option 1: a sharing plugin
  3. Option 2: plain share links
  4. Option 3: theme code
  5. After you add them
  6. Questions

Choose one of three approaches

Every share button, however it is styled, does the same thing: it opens a network's share dialog with your page address filled in. What differs is how much code runs on your page before anyone clicks. That is the real decision, because it controls page speed, privacy exposure and how much can break later.

ApproachWhat it adds to the pageBest for
Sharing pluginSettings screen, icons, optional counts, sometimes extra scriptsSites that want counts, placement rules and no code
Block or pattern with plain linksA row of links with inline icons, nothing elseBlock themes and speed-focused sites
Child theme template codeLinks printed by PHP in your post templateDevelopers who want full control and zero plugin updates

Option 1: a sharing plugin

  1. Install and activate

    In Plugins, Add New, search for share buttons and read each listing's last updated date and tested version before installing. A plugin that has not been updated for a year is a migration waiting to happen.

  2. Pick networks

    Start with three or four networks your readers actually use. More buttons lower the chance that any one is used; see which share networks to show.

  3. Set placement

    Turn on buttons after the content of posts. Add a top position or a sticky bar only if you have a reason.

  4. Decide on counts

    Leave counts off until you have read how share counts work. A row of zeros is worse than no number.

  5. Check the output

    View a post logged out, on a phone, and run it through a speed test. Confirm the buttons open the right dialog with the right address.

A share link is just a URL. The page address and, where supported, a title go into the query string, URL encoded. You can put these links in a Custom HTML block, a reusable pattern, or your theme. They load nothing from the network until clicked, which makes them the fastest and most private option.

Facebook:  https://www.facebook.com/sharer/sharer.php?u={url}
X:         https://twitter.com/intent/tweet?url={url}&text={title}
LinkedIn:  https://www.linkedin.com/sharing/share-offsite/?url={url}
Pinterest: https://pinterest.com/pin/create/button/?url={url}&media={image}
Email:     mailto:?subject={title}&body={url}

Replace the placeholders with the encoded page address, title and image. In a theme, rawurlencode( get_permalink() ) and rawurlencode( get_the_title() ) give you the values.

Option 3: theme code

If you already maintain a child theme, printing the links from single.php or a template part avoids a plugin entirely. Keep the markup semantic: a nav or ul with a visible label such as "Share this post", links with accessible names like "Share on LinkedIn", and icons marked aria-hidden.

What happens when a reader clicks a share link01Reader clicksyour page02Share URL opensencoded address03Network dialogreader edits text04Post publishedon the network
A share button only opens a dialog. The network scrapes your page's preview tags when the dialog loads.

After you add them

  • Check the link preview each network will show; fix it with Open Graph tags if the image or title is wrong.
  • Test on mobile. Buttons that fit a desktop column often wrap into two ugly rows on a phone.
  • Make sure caching plugins are not serving a stale copy of the buttons after you change settings.
  • If you use shortcodes to place buttons inside content, write down which ones. They become clutter if you ever switch tools; see removing an old share plugin cleanly.

Questions

Do share buttons help SEO?

Not directly. Shares are not a ranking factor, but shared posts get seen and linked, which can help over time. The bigger SEO effect is negative: heavy share widgets can slow pages.

Where should share buttons go?

At the end of the content first, where a reader who finished the post decides whether it was worth passing on. Add a top position or a sticky bar only after checking it does not push content down.

Can I add share buttons without a plugin?

Yes. Plain share links in a Custom HTML block or your theme work everywhere and load nothing until clicked.

Should I show share counts?

Only if you can keep them accurate and they are high enough to act as social proof. Many networks no longer provide counts at all.

Share this guide

Hannah Voss, Editor. Checks every guide against a working WordPress install and the networks' current documentation. Last reviewed September 2026.

  1. Which share networks to show, and how manyHow to choose which social share buttons to display: match networks to your audience, keep the row short, and add copy link, email and messaging options.3 min read
  2. Share buttons and page speedWhy some share buttons slow WordPress pages and others cost almost nothing. How to measure the impact, and what to change to keep sharing fast on every page.3 min read
  3. How share counts work, and why most networks stoppedHow Facebook and other networks calculate share counts, why X, LinkedIn and others removed them, what a share counter really shows, and how plugins fetch it.3 min read