You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/pages/configuration/api.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,10 @@ After you have deployed the JavaScript Worker, set a cron trigger in your Worker
64
64
65
65
Cloudflare Pages hosts and serves all project deployments on preview links. Suppose you want to keep your project private and prevent access to your old deployments. You can use the API to delete deployments after a month, so that they are no longer public online. The latest deployment for a branch cannot be deleted.
66
66
67
+
:::note
68
+
To delete individual deployments from the command line, you can use [`wrangler pages deployment delete`](/workers/wrangler/commands/#deployment-delete).
Copy file name to clipboardExpand all lines: src/content/docs/pages/configuration/preview-deployments.mdx
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,20 @@ To view branch aliases within your Pages project, select **View build** for any
70
70
71
71
You can attach a Preview alias to a custom domain by [adding a custom domain to a branch](https://developers.cloudflare.com/pages/how-to/custom-branch-aliases/).
72
72
73
+
## Delete preview deployments
74
+
75
+
To clean up old preview deployments, you can delete them using Wrangler:
Use the `--force` (or `-f`) flag to skip the confirmation prompt, which is useful for CI/CD automation. You can find deployment IDs by running [`wrangler pages deployment list`](/workers/wrangler/commands/#deployment-list).
82
+
83
+
:::note
84
+
The latest deployment for a branch cannot be deleted.
85
+
:::
86
+
73
87
## Preview indexing by search engines
74
88
75
89
To maintain a healthy SEO profile, it's vital to prevent search engines from finding duplicate content across the web. Because preview deployments are designed to be an exact replica of your production environment, they inherently create this exact situation. Cloudflare Pages by default ensures your search rankings are not harmed by these temporary previews.
Copy file name to clipboardExpand all lines: src/content/docs/pages/platform/known-issues.mdx
+3-21Lines changed: 3 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,31 +95,13 @@ If you have an issue that you do not see listed, let the team know in the Cloudf
95
95
96
96
You may not be able to delete your Pages project if it has a high number (over 100) of deployments. The Cloudflare team is tracking this issue.
97
97
98
-
As a workaround, review the following steps to delete all deployments in your Pages project. After you delete your deployments, you will be able to delete your Pages project.
99
-
100
-
1. Download the `delete-all-deployments.zip` file by going to the following link: [https://pub-505c82ba1c844ba788b97b1ed9415e75.r2.dev/delete-all-deployments.zip](https://pub-505c82ba1c844ba788b97b1ed9415e75.r2.dev/delete-all-deployments.zip).
101
-
2. Extract the `delete-all-deployments.zip` file.
102
-
3. Open your terminal and `cd` into the `delete-all-deployments` directory.
103
-
4. In the `delete-all-deployments` directory, run `npm install` to install dependencies.
104
-
5. Review the following commands to decide which deletion you would like to proceed with:
105
-
106
-
- To delete all deployments except for the live production deployment (excluding [aliased deployments](https://developers.cloudflare.com/pages/configuration/preview-deployments/#preview-aliases)):
- To delete all deployments except for the live production deployment (including [aliased deployments](https://developers.cloudflare.com/pages/configuration/preview-deployments/#preview-aliases), for example, `staging.example.pages.dev`):
98
+
As a workaround, you can use [`wrangler pages deployment delete`](/workers/wrangler/commands/#deployment-delete) to delete deployments individually. After you delete your deployments, you will be able to delete your Pages project.
To find your Cloudflare API token, log in to the [Cloudflare dashboard](https://dash.cloudflare.com), select the user icon on the upper righthand side of your screen > go to **My Profile** > **API Tokens**.
119
-
120
-
You need a token with `Cloudflare Pages Edit` permissions.
121
-
122
-
To find your Account ID, refer to [Find your zone and account ID](/fundamentals/account/find-account-and-zone-ids/).
104
+
Use the `--force` flag to skip the confirmation prompt, which is useful for scripting bulk deletions.
123
105
124
106
## Use Pages as Origin in Cloudflare Load Balancer
0 commit comments