Hi Payload Community! Please, could somebody explain, how can I update og meta tags like title,description, image for a root page? I successfully updated it for every page, but when I’m sharing my website with just base route it is showing default Payload properties like : Payload E-Commerce Template, An open-source e-commerce store…
I deleted all mentions of this locally but it is still displaying on link preview.
Here is visual example, just so that it is clear, this is the same page I try to share, but if there is no /home , default properties for OG tags are used. I’ve set custom properties for pages on admin dashboard, but how can I set them for base route sharing?
You can Change it in the seo Field (backend) there is a option for images, description and Open-Graph Image
Thank you for your response. As I said, I’ve change these fields for every page, but this is not working for the root website link. Is there any global configs for these fields, not for a specific page?
It will work, Payload 67 and the seo Plugin. This is the Home (Start) Page
In this case I’m talking more about OG meta tags that are used for social network sharing
You can add this Manuel in the Layout.tsx file
I have in the Showcase section also a Working Dynamic Sitemap.ts for website and Posts
And dont forgot the Robot.txt
Here is a Working dynamic sitemap.xml for payload v3 with posts!
import { MetadataRoute } from 'next'
const serverUrl = 'https://your-url.com'
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const { docs: posts } = await fetch(`${serverUrl}/api/posts?limit=0`).then((res) =>
res.json(),
)
const sitemap: MetadataRoute.Sitemap = []
for (const post of posts) {
sitemap.push({
changeFrequency: 'weekly',
lastModified: post.updatedAt,
priority: 1,
url: `${serverUrl}/posts/${post.slug}`,
})
}
return [
...sitemap,
{
url: 'https://your-url.com',
lastModified: new Date(),
changeFrequency: 'weekly',
priority: 1,
},
]
}I just need to modify OG meta tags for social network sharing, that’s all. Like in this example, I’m sharing the same website, moreover, it is same page. But for first message I just shared a base link, and for the second one I added /home . So how to make sure this is also updated for the base url? I’ve added manually meta tags to Head section of a base layout.tsx, but it is still display default values
This is only with the seo Plugin in Payload. Social Sharing Homepage
Sharing in WhatsApp
Only the Plugin in Payload and its work
That will also work with /home
Did you find the Problem?
Hey
@287996619125948417you'll find the Meta for that in
src/app/_utilities/mergeOpenGraph.tsIf you have a
/homepage however, the Meta for that page
shouldoverride the defaults above
Yeah, thank you guys. It is working now. I set /home to be default initial route. Now there is another issue when sharing specific page. In example below I’m sharing product page link, title and description is coming from product seo fields, but image is not. It displays image that was set in seo field for the whole products page, not the specific product from this page
Star
Discord
online
Get dedicated engineering support directly from the Payload team.