Skip to content

Commit ac510ab

Browse files
authored
✨ Add "Allow search engines to index" option (#2163)
# Configure the robots meta tag to allow search and link crawlers ## Description Closes #1123 This PR adds the "Allow indexing" metadata option. This feature allows users to control whether search engines like Google and LinkedIn can index their Typebot content by removing the `noindex` meta tag when enabled. ## Changes - Updated `MetadataForm.tsx` to include a new switch toggle to allow indexing - Updated `Seo.tsx` to remove the `noindex` tag when indexing is enabled - Made the appropriate changes for the typebot settings schema to include the allow indexing option - Added translations for the following keys to `en.json`, `fr.json`, `pt-BR.json`, `pt.json` language files: - `settings.sideMenu.metadata.allowIndexing.label`: "Allow search engines to index" - `settings.sideMenu.metadata.allowIndexing.tooltip`: "When enabled, the noindex meta tag will be removed, allowing search engines like Google and LinkedIn to index your typebot." ## Screenshots ![Capture-2025-05-10-114206](https://github.com/user-attachments/assets/7cbc32bf-8fe1-49d6-8db0-abd508b3e69f)
1 parent 34a8da5 commit ac510ab

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

apps/builder/src/features/settings/components/MetadataForm.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ImageUploadContent } from "@/components/ImageUploadContent";
22
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
33
import { TextInput, Textarea } from "@/components/inputs";
44
import { CodeEditor } from "@/components/inputs/CodeEditor";
5+
import { SwitchWithLabel } from "@/components/inputs/SwitchWithLabel";
56
import {
67
FormLabel,
78
HStack,
@@ -46,6 +47,8 @@ export const MetadataForm = ({
4647
onMetadataChange({ ...metadata, googleTagManagerId });
4748
const handleHeadCodeChange = (customHeadCode: string) =>
4849
onMetadataChange({ ...metadata, customHeadCode });
50+
const handleAllowIndexingChange = (allowIndexing: boolean) =>
51+
onMetadataChange({ ...metadata, allowIndexing });
4952

5053
const favIconUrl =
5154
metadata?.favIconUrl ??
@@ -155,6 +158,12 @@ export const MetadataForm = ({
155158
withVariableButton={false}
156159
/>
157160
</Stack>
161+
<SwitchWithLabel
162+
label={t("settings.sideMenu.metadata.allowIndexing.label")}
163+
initialValue={metadata?.allowIndexing}
164+
onCheckChange={handleAllowIndexingChange}
165+
moreInfoContent={t("settings.sideMenu.metadata.allowIndexing.tooltip")}
166+
/>
158167
</Stack>
159168
);
160169
};

apps/builder/src/i18n/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@
474474
"settings.sideMenu.metadata.icon.label": "Icon:",
475475
"settings.sideMenu.metadata.image.label": "Image:",
476476
"settings.sideMenu.metadata.title.label": "Title:",
477+
"settings.sideMenu.metadata.allowIndexing.label": "Allow search engines to index",
478+
"settings.sideMenu.metadata.allowIndexing.tooltip": "When enabled, the noindex meta tag will be removed, allowing search engines like Google to index your typebot.",
477479
"settings.sideMenu.security": "Security",
478480
"settings.sideMenu.security.allowedOrigins": "Allowed origins",
479481
"settings.sideMenu.security.allowedOrigins.tooltip": "Restrict the execution of your typebot to specific website origins. By default your bot can be executed on any website.",

apps/viewer/src/components/Seo.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ export const SEO = ({
2424
favIconUrl,
2525
imageUrl,
2626
googleTagManagerId,
27+
allowIndexing,
2728
} = {},
2829
}: SEOProps) => (
2930
<>
3031
<Head key="seo">
3132
<title>{title ?? typebotName}</title>
32-
{isMatchingViewerUrl ? <meta name="robots" content="noindex" /> : null}
33+
{isMatchingViewerUrl && allowIndexing !== true ? (
34+
<meta name="robots" content="noindex" />
35+
) : null}
3336
<link
3437
rel="icon"
3538
type={favIconUrl ? "image/png" : "images/svg+xml"}

packages/settings/src/schemas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const metadataSchema = z.object({
4949
favIconUrl: z.string().optional(),
5050
customHeadCode: z.string().optional(),
5151
googleTagManagerId: z.string().optional(),
52+
allowIndexing: z.boolean().optional(),
5253
});
5354

5455
const startConditionSchema = z.object({

0 commit comments

Comments
 (0)