Skip to content

Instantly share code, notes, and snippets.

@L422Y
Last active July 15, 2026 17:50
Show Gist options
  • Select an option

  • Save L422Y/53b75be4bb8afd5cd6143e74150cc142 to your computer and use it in GitHub Desktop.

Select an option

Save L422Y/53b75be4bb8afd5cd6143e74150cc142 to your computer and use it in GitHub Desktop.
Mass cancel Amazon Subscribe and Save
  1. Open your subscriptions page:
https://www.amazon.com/auto-deliveries/subscriptionList?shipId=mpkmmwlssrkq&ref_=mys_nav_op_D
  1. Paste into devtools console
  2. Wait a few moments, and then refresh/repeat for any additional pages
  3. Confirm by checking to see if you've received cancellation emails
await Promise.all([...document.querySelectorAll('[data-subscription-id]')]
  .map(el => el.getAttribute('data-subscription-id'))
  .map(async (subscriptionId) => {
    try {
      const res = await fetch(`https://www.amazon.com/auto-deliveries/ajax/cancelSubscription?deviceType=desktop&deviceContext=web&subscriptionId=${subscriptionId}`)
      const cancelPanel = await res.text()

      const div = document.createElement('div')
      div.innerHTML = cancelPanel
      document.body.appendChild(div)

      const form = div.querySelector("form[name='cancelForm']")
      if (form) {
        const formData = new FormData(form)
        const formEntries = Object.fromEntries(formData.entries())

        await fetch(form.action, {
          method: form.method,
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
          },
          body: new URLSearchParams(formEntries)
        })

        div.remove()
      }

      return 'ok'
    } catch (reason) {
      return `error: ${reason}`
    }
  })
)
@vlussenburg

Copy link
Copy Markdown

Thanks. Worked perfectly on 2/6/26

@Jason-LJQ

Copy link
Copy Markdown

Thanks a lot!

@kranix0

kranix0 commented Jul 8, 2026

Copy link
Copy Markdown

Thanks for this @L422Y – I made a userscript wrapper that button to the page and supports Amazon AU/UK/etc by rewriting the marketplace origin at runtime. No need for a devtools console.

I’d like to share the wrapper publicly with proper attribution, but I noticed this gist doesn’t include a licence. Would you be willing to add a licence, such as MIT, or otherwise confirm how you’re happy for forks/derivatives to be shared?

@L422Y

L422Y commented Jul 8, 2026

Copy link
Copy Markdown
Author

Thanks for this @L422Y – I made a userscript wrapper that button to the page and supports Amazon AU/UK/etc by rewriting the marketplace origin at runtime. No need for a devtools console.

I’d like to share the wrapper publicly with proper attribution, but I noticed this gist doesn’t include a licence. Would you be willing to add a licence, such as MIT, or otherwise confirm how you’re happy for forks/derivatives to be shared?

so long as you credit / link this gist, doesn't matter to me!

@kranix0

kranix0 commented Jul 9, 2026

Copy link
Copy Markdown

so long as you credit / link this gist, doesn't matter to me!

Awesome, thanks! Here is the userscript. It adds a button to the page. All you need to do is click it.

@verxolois

Copy link
Copy Markdown

so long as you credit / link this gist, doesn't matter to me!

Awesome, thanks! Here is the userscript. It adds a button to the page. All you need to do is click it.

Just tried this and button works perfectly, thanks!

@kranix0

kranix0 commented Jul 10, 2026

Copy link
Copy Markdown

@verxolois thanks for the feedback! I made a fix to the update URL (along with other improvements) which will require a one-off manual reinstall. Then it should auto-update.

@verxolois

verxolois commented Jul 10, 2026

Copy link
Copy Markdown

@verxolois thanks for the feedback! I made a fix to the update URL (along with other improvements) which will require a one-off manual reinstall. Then it should auto-update.

thank! installed again, but can no longer test it since ur previous button clear'd my sub page :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment