• websites



The amp-facebook-comments component allows embedding Facebook comments into AMP files.


Import the amp-facebook-comments component

<script async custom-element="amp-facebook-comments" src=""></script>

Basic usage

The amp-facebook-comments component only requires the href of the comments.

<amp-facebook-comments width="486" height="657" layout="responsive" data-href="">

Internationalization support

You can set the locale to render the comments in a different language, for example French by specifying data-locale="fr_FR".

<amp-facebook-comments width="552" height="310" layout="responsive" data-order-by="social" data-href="" data-locale="fr_FR">

Limit number of comments

You can restrict the number of comments to show at a time by specifying data-numposts="5".

<amp-facebook-comments width="552" height="310" layout="responsive" data-numposts="5" data-href="">


Set the color scheme of the comments to be dark by specifying data-colorscheme="dark".

<amp-facebook-comments width="552" height="310" layout="responsive" data-colorscheme="dark" data-href="">

Comment ordering

By default the comments are ordered in order of most popular, you can change that to be time based by specifying data-order-by="time".

<amp-facebook-comments width="552" height="310" layout="responsive" data-order-by="time" data-href="">
</amp-facebook-comments>  </body>
Need further explanation?

If the explanations on this page don't cover all of your questions feel free to reach out to other AMP users to discuss your exact use case.

Go to Stack Overflow
An unexplained feature?

The AMP project strongly encourages your participation and contributions! We hope you'll become an ongoing participant in our open source community but we also welcome one-off contributions for the issues you're particularly passionate about.

Edit sample on GitHub