Reactive Meta Tags

I am trying to add meta tags onto my website based on the page it is on and contents on the page (can be determined using a callback, for example).

However, I’m not sure how to do this as if I add meta tags in app.py inapp = dash.Dash, they seem to be fixed and cannot be reactive/change based on the page itself.

Any help would be appreciated!

1 Like

Check out the index functions in Adding CSS & JS and Overriding the Page-Load Template | Dash for Python Documentation | Plotly

This will also be easier in our forthcoming pages feature: 📣 Introducing Dash `/pages` - A Dash 2.x Feature Preview

Welcome to Dash :slight_smile:

1 Like

Thanks! Is there a way to just overide/create an index function for the head of the HTML but not the body?

there isn’t at the moment

@chriddyp could you please provide a simple working example where you change e.g. the content of this meta tag: <meta property="og:title" content="foo"> based on a user switching between a radio button of two choices “foo” and “bar”?
I dug into the docs but I didn’t have enough experience to figure this out.