Skip to content

Instantly share code, notes, and snippets.

@L422Y
Last active June 27, 2026 14:40
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}`
    }
  })
)
@BBlackwo

Copy link
Copy Markdown

This script was a lifesaver! Thank you! Works for different domains too. Just needed to change from .com to .com.au.

@mikoshi-cmd

Copy link
Copy Markdown

Thank you so much! they were driving me insane.

@Pengle302

Copy link
Copy Markdown

I could use some help! I am new to this :-)
I went to my Amazon S&S subscriptions page, then
I opened my Chrome devtools console, allowed pasting, and pasted the script...but nothing happened.
Am I doing it wrong?
thanks in advance!

@L422Y

L422Y commented Mar 11, 2025

Copy link
Copy Markdown
Author

I opened my Chrome devtools console, allowed pasting, and pasted the script...but nothing happened.

Did you hit enter to run it? :) Any errors in the console?

@Pengle302

Copy link
Copy Markdown

@L422Y
Hi there...I responded to your email but am unsure if you received it, so I'm also answering here:
I did press 'Enter' and a prompt appeared at the next line. Also, only warnings I saw were regarding "'https://www.youtube.com') does not match the recipient window's origin ('https://www.google.com" which did not seem relevant to me, but unsure what that was from.
Hope you csn get me on the right track, and apologies for any redundancy re: replying.

@L422Y

L422Y commented Mar 11, 2025

Copy link
Copy Markdown
Author

I imagine those are probably from extensions you have installed, you can try in an incognito window, but if there's not errors related to the code above I can't really help

@cuddlytoaster

Copy link
Copy Markdown

absolute lifesaver thank you

@OrderAndCh4oS

Copy link
Copy Markdown

Can confirm it works for .co.uk just swap out the .com. Thanks for this, it saved so much time.

@DVTPDX

DVTPDX commented Aug 16, 2025

Copy link
Copy Markdown

This worked great! For those who don't know how to use this, just open the console in your web browser and paste the code in. This instantly removed 30+ subscriptions within seconds. Thank you!

@vlussenburg

Copy link
Copy Markdown

Thanks. Worked perfectly on 2/6/26

@Jason-LJQ

Copy link
Copy Markdown

Thanks a lot!

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