Skip to content

Commit af4a10c

Browse files
authored
fix(seo): prevent booking confirmation pages from being indexed (calcom#26058)
Booking confirmation pages contain PII (names, emails, phone numbers) and should not be indexed by search engines - Add robots noindex to /booking/[uid]/page.tsx - Add robots noindex to /booking/[uid]/embed/page.tsx Follows same pattern as not-found.tsx
1 parent 90a83a6 commit af4a10c

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

apps/web/app/(booking-page-wrapper)/booking/[uid]/embed/page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ import {
1313
type PageProps as ClientPageProps,
1414
} from "~/bookings/views/bookings-single-view.getServerSideProps";
1515

16+
export const metadata = {
17+
robots: {
18+
index: false,
19+
follow: false,
20+
},
21+
};
22+
1623
const getEmbedData = withEmbedSsrAppDir<ClientPageProps>(getServerSideProps);
1724

1825
const ServerPage = async ({ params, searchParams }: ServerPageProps) => {

apps/web/app/(booking-page-wrapper)/booking/[uid]/page.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ import {
1616
type PageProps as ClientPageProps,
1717
} from "~/bookings/views/bookings-single-view.getServerSideProps";
1818

19+
const getData = withAppDirSsr<ClientPageProps>(getServerSideProps);
20+
1921
export const generateMetadata = async ({ params, searchParams }: _PageProps) => {
2022
const { bookingInfo, eventType, recurringBookings, orgSlug } = await getData(
2123
buildLegacyCtx(await headers(), await cookies(), await params, await searchParams)
2224
);
2325
const needsConfirmation = bookingInfo.status === BookingStatus.PENDING && eventType.requiresConfirmation;
2426

25-
return await _generateMetadata(
27+
const metadata = await _generateMetadata(
2628
(t) =>
2729
t(`booking_${needsConfirmation ? "submitted" : "confirmed"}${recurringBookings ? "_recurring" : ""}`),
2830
(t) =>
@@ -31,9 +33,15 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) =>
3133
getOrgFullOrigin(orgSlug),
3234
`/booking/${(await params).uid}`
3335
);
34-
};
3536

36-
const getData = withAppDirSsr<ClientPageProps>(getServerSideProps);
37+
return {
38+
...metadata,
39+
robots: {
40+
index: false,
41+
follow: false,
42+
},
43+
};
44+
};
3745

3846
const ServerPage = async ({ params, searchParams }: _PageProps) => {
3947
const context = buildLegacyCtx(await headers(), await cookies(), await params, await searchParams);

0 commit comments

Comments
 (0)