---
title: Share Button
description: Share Button allows you to add a share button to your posts, making it easy for readers to share your content on social media.
url: https://developers.wpengine.com/docs/newsroom/mediapress/share-button/
image: https://developers.wpengine.com/og/docs/newsroom/mediapress/share-button.png
---

# Share Button

Share Button allows you to add a share button to your posts, making it easy for readers to share your content on social media.

## Hooks and filters

### PHP filters

#### `mediapress_share_button_block_platforms`

Configure the platforms used within the share block modal.

**Default Value:**

```php
<?php
[
  'facebook' => [
    'label' => 'Facebook',
    'url'   => 'https://www.facebook.com/sharer/sharer.php?u=%%URL%%',
    'icon'  => '',
  ],
  'x'        => [
    'label' => 'X',
    'url'   => 'https://x.com/intent/tweet?url=%%URL%%',
    'icon'  => '',
  ],
  'linkedin' => [
    'label' => 'LinkedIn',
    'url'   => 'https://www.linkedin.com/sharing/share-offsite/?url=%%URL%%',
    'icon'  => '',
  ],
]
```

**Example:**

```php
<?php


add_filter( 'mediapress_share_button_block_platforms', 'myexample_available_platforms' );


function myexample_available_platforms( $platforms ) {
  // remove linkedin
  unset( $platforms['linkedin'] );


  $platforms['bluesky'] = [
    'icon' => '',
    'label' => 'BSky',
    // Note: See %%URL%% to dictate where the url will be placed.
    'url' => 'https://bsky.app/intent/compose?text=%%URL%%'
  ];


  // this should be html like an svg/img tag
  $platforms['x']['icon'] = '<img src="https://place-hold.it/40" />';


  return $platforms;
}
```

## Was this helpful?

Thanks for the feedback!

```json
{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://developers.wpengine.com/#website","name":"WP Engine Product Documentation","url":"https://developers.wpengine.com/","description":"Resources for developing, deploying, and scaling on WP Engine.","inLanguage":"en-US","keywords":["API documentation","product documentation","headless WordPress","managed WordPress hosting"],"publisher":{"@id":"https://wpengine.com/#organization"}}]}
```
