How to add a Follow button to your website
The publish.x.com website includes a simple tool to generate the embed for a Follow button to copy-and-paste into your website template. Just enter a @screenName to get started.Manually
- Create an anchor element with a
twitter-follow-buttonclass name. Set thehrefattribute value pointing to a X profile URL.
- Customize Follow button parameters using
data-*attributes.
- Asynchronously load the X for Websites JavaScript using our loading snippet. The script will initialize the Follow button after your page content loads.
Button customization
Hide username
Hide the username from the displayed Follow button by setting adata-show-screen-name attribute value of false.
Large button style
Add adata-size attribute value of large to display a larger Follow button.