Adding a Meta description to your streamlit app

Hi All,

It seems that the title and description that appears in social preview and in Google search results require different implementation for tackling the issue.

Firstly, the meta title and description that is indexed in Google search results appears to be taken directly from the Streamlit app page. Particularly, the meta title is taken from the page title via st.title or st.header. As for the meta description, it is taken from the text appearing underneath the title text.

Secondly, the meta title shown in social preview is as specified by st.set_page_config(page_title="My App") while the description is taken from the GitHub repo’s README.md file (See Share previews - Streamlit Docs).

Hope this helps!

@dataprofessor

It’s worth noting this solution ONLY works if your application is hosted on Streamlit Community Cloud. In my opinion there’s no actual “hack-less” fix to deploy custom metadata to your own custom domain.

The only way I’ve managed to deploy metadata is by a custom docker image, which is going to be risky to maintain!

I think this feature is one of very few holding Streamlit back from competing with the likes of Flask, Django and FastAPI

1 Like

Hi @chrissamharris

Thanks for the suggestion, and yes the suggested solution is for apps hosted on Community Cloud. Could you make a formal feature request here.

1 Like