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).
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
Hi, is there any update on this? I am a beginner and a solution like st.set_page_config(meta = ‘A little description of the app for a better SEO on google’) would be ideal. Same with the name
Thanks a lot for your update. It’s been a long time and unfortunately I can’t progress much to do this work due to my ongoing graduate study. I really appreciate everyone working on that feature.