---
title: Configuring automatic posting to social media
related:
  - https://docs.kentico.com/13/integrating-3rd-party-systems/integrating-social-media/connecting-xperience-to-social-media.md
  - https://docs.kentico.com/13/integrating-3rd-party-systems/integrating-social-media/adding-social-media-accounts.md
  - https://docs.kentico.com/13/integrating-3rd-party-systems/integrating-social-media/posting-to-social-media.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

You can post messages to **Facebook** and **Twitter**, and send company updates to **LinkedIn** directly from Xperience in the **Pages** application.

You have the following options to publish content from within the editing interface to the supported social media. Each of them is suitable for a different situation.

- To post information about a certain section of the content tree, regardless of the page type, choose [Publishing to social media using a workflow step](#publishing-to-social-media-using-a-workflow-step).
- To post information about pages of one specific page type (e.g., article), either manually or automatically at the time of publishing, choose [Publishing to social media using form controls](#publishing-to-social-media-using-form-controls).

In both these cases, you post to the chosen social media from within the interface where you edit a page. You can use macros in the post, for example, to insert the URL of the page into the post.

## Publishing to social media using a workflow step

You can post messages to social media as part of a page's workflow process using the **Publish to Facebook**, **Publish to Twitter**, and **Publish to LinkedIn** workflow steps. You can use this approach to automatically publish information about pages in a section of your site's content.

> **Info:** If you want to write a message and publish it to social media directly from the page editing interface, consider using the respective [form controls](#publishing-to-social-media-using-form-controls).

1. [Connect Xperience to the social media](https://docs.kentico.com/13/integrating-3rd-party-systems/integrating-social-media/connecting-xperience-to-social-media.md) and [Add a social media account](https://docs.kentico.com/13/integrating-3rd-party-systems/integrating-social-media/adding-social-media-accounts.md).
2. Edit the social media account that you want to publish to.
3. Enable the **Default** check box and save the social media account.
   - The Default check box designates the account as the account that advanced workflow should use. You can have only one default account per one social media.
4. [Create an advanced workflow](https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-workflows/designing-advanced-workflows.md) with the **Publish to Facebook**, **Publish to Twitter**, or **Publish to LinkedIn** step.

   ![Publishing to Twitter using advanced workflow](https://docs.kentico.com/docsassets/13/configuring-automatic-posting-to-social-media/publish_twitter_workflow.png "Publishing to Twitter using advanced workflow")
5. Set the **Text** of the message that will be automatically posted to Facebook/Twitter/LinkedIn in the **Workflow step properties**. You can use [macros](https://docs.kentico.com/13/macro-expressions.md) in the message.
   - For example, _Check out our new blog post at {% AbsoluteURL() %}_. The resulting URL could then look like this: _www.example.com/blog/my-latest-blog-post_
6. (Optional) Enable **Post only once** to avoid multiple posts related to one page.
   - Providing the property is enabled, the workflow action doesn't create more posts **if there is already a post related to the page in the system**.
7. Create a page using this defined workflow.

When advancing over the Publish to Facebook/Publish to Twitter/Publish to LinkedIn step in the workflow, the predefined message will be automatically posted. The message will appear in Xperience in the **Facebook**,**Twitter**, or **LinkedIn** application.

> **Note:** **Using macros in tweet text**
>
> If you use macros in the Text property of the Publish to Twitter text, the remaining character counter reflects the length of the macro string, not the length of the resulting text.
>
> Use the **LimitLength** macro to ensure the result of other macros does not exceed the tweet character limit.
>
> **Syntax**\*:\* `String LimitLength (String text, Int32 length)`
>
> **Example**: `{% LimitLength(DocumentName, 20) %}` – inserts the name of the current page but limits the length to 20 characters.

## Publishing to social media using form controls

By adding the **Facebook auto post**, **Twitter auto post**, and **LinkedIn auto post** form controls to a page type, you can enable editors to post messages to social media from the page editing interface.

1. [Connect Xperience to the social media](https://docs.kentico.com/13/integrating-3rd-party-systems/integrating-social-media/connecting-xperience-to-social-media.md) and [Add a social media account](https://docs.kentico.com/13/integrating-3rd-party-systems/integrating-social-media/adding-social-media-accounts.md).
2. Open the **Page types** application.
3. **Edit** () the chosen page type.
4. On the **Fields** tab, click **New field**.
5. Set up the following properties:
   - **Field name**
   - **Data type**: _Long text_ or _Text_
   - **Field caption**
   - **Form control**: _Facebook auto post_, _Twitter auto post_ or _LinkedIn auto post_
6. Click **Save**.

When you edit a page of the modified type in the **Pages** application, a new field appears on the **Form** or **Content** tab. The field allows editors to compose a message to be posted on social media.

![Posting to Facebook from the Pages application](https://docs.kentico.com/docsassets/13/configuring-automatic-posting-to-social-media/publish_facebook_pages.png "Posting to Facebook from the Pages application")

When the editor saves the page, the system publishes their post on the chosen social media account (Facebook page, LinkedIn company profile or Twitter channel). If the editor sets the **Publishing time** to a future time, the system schedules the publishing of the post to the specified time. Users can view both scheduled and published posts in Xperience in the **Facebook**, **Twitter**, or **LinkedIn** application.

> **Note:** Editors need permissions for the **Social media** module to use automatic posting – either **Modify** or **Modify posts**.
