Fiaz Technologies
Usage

Set Metadata

Learn how to set metadata in PyWebflow to configure SEO and social sharing properties.

Setting Metadata

The set_metadata method in PyWebflow allows you to define SEO and social media metadata for your web application.

Usage

First, import the WebFlow library:

import webflow as wf

Then, use the set_metadata method as follows:

wf.set_metadata(
title="",
description="",
keywords="",
...
)

Parameters

ParameterTypeDescription
titlestrThe title of the page, used in search engines and browser tabs.
descriptionstrA short description of the page for SEO and social media.
keywordsstrA comma-separated list of keywords for search engine optimization.
authorstrThe name of the author of the page.
viewportstrDefines how the page scales on different screen sizes.
charsetstrSpecifies the character encoding for the document.
robotsstrDetermines how search engines should index the page ("index, follow", "noindex, nofollow").
canonicalstrThe canonical URL to avoid duplicate content issues.
ogTitlestrOpen Graph title for social media sharing.
ogDescriptionstrOpen Graph description for social media previews.
ogUrlstrThe URL to be associated with the Open Graph metadata.
ogImagestrThe image URL for social media sharing previews.

Example

wf.set_metadata(
title="My Awesome App",
description="An innovative web application built with Webflow and FastAPI.",
keywords="web development, python, fastapi, react",
author="Awesome Dev",
viewport="width=device-width, initial-scale=1.0",
charset="UTF-8",
robots="index, follow",
canonical="https://example.com",
ogTitle="My Awesome App",
ogDescription="An innovative web application built with Webflow and FastAPI.",
ogUrl="https://example.com",
ogImage="https://example.com/preview.png"
)

Additional Notes

  • Ensure your canonical URL is correct to prevent duplicate content penalties in search engines.
  • Open Graph (og*) metadata is crucial for optimizing social media previews.
  • Use relevant keywords but avoid keyword stuffing for better SEO results.
Edit on GitHub

Last updated on

On this page