W
Wasp2mo ago
johnsharp.

SEO snippet

In wasp how can I define what shows up in the snippet on search engine listing
3 Replies
kapa.ai
kapa.ai2mo ago
Hi @johnsharp.. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To define what shows up in the search engine listing snippet for your Wasp application, you can use the head property in your main.wasp file. This allows you to add meta tags and other elements to the <head> section of your HTML document, which search engines use to generate snippets. Here's how you can do it: 1. Open your main.wasp file. 2. Locate or add the app declaration. 3. Within the app declaration, use the head property to add your SEO-related tags. Here's an example of how you can set it up:
app MyApp {
title: "My Awesome App",
head: [
"<meta name='description' content='This is my awesome app built with Wasp'>",
"<meta property='og:title' content='My Awesome App'>",
"<meta property='og:description' content='This is my awesome app built with Wasp'>",
"<meta property='og:image' content='<https://myapp.com/og-image.png'>",>
"<meta property='og:url' content='<https://myapp.com'>">
]
}
app MyApp {
title: "My Awesome App",
head: [
"<meta name='description' content='This is my awesome app built with Wasp'>",
"<meta property='og:title' content='My Awesome App'>",
"<meta property='og:description' content='This is my awesome app built with Wasp'>",
"<meta property='og:image' content='<https://myapp.com/og-image.png'>",>
"<meta property='og:url' content='<https://myapp.com'>">
]
}
In this example, we've added a meta description and Open Graph tags, which are commonly used for SEO and social media sharing. You can customize these tags to fit your specific needs. It's worth noting that while this method allows you to set static meta tags, Wasp currently doesn't have built-in support for dynamic SEO tags or server-side rendering (SSR). However, this approach can still significantly improve your app's SEO. For more information on customizing your app's <head> section, you can refer to the Wasp documentation on customizing the app (https://wasp-lang.dev/docs/project/customizing-app#api-reference). Additionally, it's important to mention that while having proper meta tags is crucial for SEO, it's not the only factor. As pointed out by a Wasp community member, even without SSR, Google is quite good at scraping websites and can index JavaScript-rendered content. A well-structured application with good content can still achieve good search engine rankings Discord discussion (https://discord.com/channels/686873244791210014/1219684155072184440). Wasp is planning to improve its SEO capabilities in the future, so keep an eye on updates for more advanced SEO features GitHub Issue (https://github.com/wasp-lang/wasp/issues/1910). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @johnsharp., I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
NEROX
NEROX2mo ago
Hey @johnsharp. , here you have a SEO thread that may help you: #Something wrong with SEO?
martinsos
martinsos2mo ago
Thanks @NEROX for being our SEO expert!

Did you find this page helpful?