How to Cancel A Pending MetaMask Transaction (2023 Guide)

Sometimes when submitting a transaction on Metamask you find yourself waiting for the transaction to go through. But in some instances, the transaction might get stuck or will be pending for a long time. Knowing how to cancel a queued transaction in Metamask can be a lifesaver.

Below are steps you can take to solve pending transactions for any network you use in Metamask including Ethereum, Fantom, Polygon, Avalanche, Binance, etc.

How to Cancel a Pending Metamask Transaction

Methods to fix a pending transaction in Metamask.
Methods to fix a pending transaction

There are five main methods to get a pending transaction in Metamask unstuck. They are listed below in order of ease and speediness.

Press the In-app cancel button

The cancel button in Metamask.
The cancel button

The simplest way to cancel a pending transaction is to press the Cancel button. A cancellation can only be done if the transaction is still pending on the network. If a transaction has already been confirmed on the blockchain, it can’t be undone.

Try to Speed Up the transaction

If you can’t simply cancel the transaction, then you can try to speed it up. Essentially, you are re-submitting the same transaction, but with a higher gas fee in an attempt to process the transaction faster.

Speeding up a transaction re-uses the same nonce (a number used to identify transactions) so you don’t need to pay for gas twice, however, it will increase the amount you’re spending to process the transaction.

The Speed Up button in Metamask.
The Speed Up button

To speed up your pending transaction, go to the transaction and press the button that says Speed Up.

Submit a custom nonce

A custom nonce involves sending a new transaction with the same nonce of the pending transaction. When sending this transaction, you don’t need to actually send anything of value. You can send 0 ETH, for example.

Submitting a custom nonce video

The point of sending a new transaction with the same nonce to the network is to replace the pending transaction, which in turn, cancels it. This method almost always works to cancel any pesky pending transaction you might have.

The important thing is to ensure you pay enough gas for the network to prioritize the transaction. Also, this method requires you to work backward from the oldest pending transaction in the queue that you wish to cancel.

If you have multiple pending transactions you will need to do this for each one. Hence, you can’t cancel a transaction with a nonce of 5 before canceling 4.  

Below are the steps you need to take to submit a custom nonce.

Custom transaction nonce and advance gas controls settings.
Enable these settings
  1. Turn on Customize transaction nonce and Advanced gas controls in advanced settings. This will enable you to edit the gas you pay and make sure your cancellation transaction is processed before the original one you want to cancel.
Transaction nonce on Etherscan
Go to the pending transaction and copy its nonce
  1. Send a new transaction. In the new transaction, enter your wallet’s public address to send it to yourself. Fill in ‘Custom Nonce’ with the same nonce as the transaction that is still pending.
Custom nonce option in Metamask.
Enter the pending nonce into the new transfer
  1. Now tap ‘Edit’ next to ‘Gas Fee’ (this might appear as ‘Market’). You’ll see the below options:

Gas limit. The maximum number of units of gas you’re willing to pay for the blockchain to complete the transaction.

Max priority fee (Gwei). Paid to the validator and incentivizes them to prioritize your transaction.

Max fee (Gwei). The total amount paid for your transaction: base fee + priority fee.

To ensure your cancellation request is prioritized before the original, you need to pay more for gas. To do this, follow the steps below.

Editing the transaction priority in Metamask.
Set these limits slightly higher
  • Set your gas limit slightly higher than your original transaction. 
  • Set your max priority fee to at least 10% higher (in Gwei) than the gas fee of the original (pending) transaction (if that transaction had a gas fee of 30 Gwei, set the max priority fee to 33-35 Gwei). 
  • Make sure your max fee is at least 30% higher than the max fee of the transaction you’re replacing. For example, if your previous fee was 100 Gwei, input something like 150 Gwei.

Reset your Metamask account

Three steps to reset your Metamask account.
Three steps to reset your account

If the cancel button isn’t an option and you don’t want to or can’t afford to pay the custom nonce, your last option is to reset your Metamask account. This will clear all your transactions without affecting your funds.

That said, if you go this route you may need to manually add the tokens back into your wallet for them to be displayed.

To do this, sign into Metamask, go to the Tokens tab, press “Import Tokens”, then search for the tokens you previously had in your wallet and select them, they will then appear in your wallet with your balance.

Also, you must have your Secret Recovery Phrase available as you’ll need it to sign back into your wallet.

Now that we’ve established that, let’s reset your account. To reset your Metamask account follow these steps:

  1. Click the account icon in the top-right of Metamask
  2. Choose Settings
  3. Choose Advanced Settings
  4. Tap Reset Account

After resetting your account, be sure to close out of the browser before jumping back into Metamsak to enter your secret phrase.

NOTE: Don’t reset your wallet if you still see the transaction pending on the blockchain explorer. Rather, try speeding it up or canceling it if possible.

Wait for the transaction to go through

You can also wait for the transaction to go through. Although this is the easiest solution since it requires no effort on your end, it takes the most amount of time. Furthermore, sometimes the transaction never goes through until you take action.

That said, you could end up waiting days just to find out it’s still stuck and you need to do something about it. If you’re lucky, the transaction might go through eventually.

Why Do Transactions Get Stuck?

A transaction could get stuck for a number of reasons, the most common being a congested blockchain network and higher gas fees than usual. If the network is busy or you paid too low of a gas fee and the transaction made it to the explorer, you might be able to speed up or cancel the transaction.

If your transaction is stuck, you should first check it using a blockchain explorer to see if it has made it to the explorer. Here are the explorers for each respective network.

Etherscan public blockchain explorer.
Enter your wallet’s address

To view your transactions on an explorer copy your public wallet address, paste it into the appropriate explorer (depending on which blockchain the pending transaction is on), then scroll down to view your most recent transactions.

A list of my transactions in Etherscan.
Check to see if the transaction is pending

If the transaction still shows pending on the explorer you can try to speed up or cancel the transaction.

Does Metamask Charge to Cancel a Transaction?

Metamask itself doesn’t charge you to cancel a pending transaction. The cost to submit the cancellation is a gas fee. This fee can range from $2 to over $100. The only fee Metamask will ever charge you is 0.875% for their Swaps service when converting one cryptocurrency to another.

If you want to save on gas fees you should try to cancel the transaction early in the morning or late at night when the network is less congested. This depends on the timezone you’re in. You can use the Ethereum Gas Tracker to see if gas prices are on the rise or at a low point for the day. 

Also, you can choose the ‘Low’ Priority option when confirming the transaction. This option generally takes longer, but if the blockchain isn’t too busy at the time then it only takes a couple of seconds.

Can Metamask Gas Fees Be Refunded?

Metamask gas fees can’t be refunded. These fees are paid directly to network validators for their efforts to secure the blockchain. Metamask does not determine these fees nor does it receive any portion of the transaction fees. Without gas fees, validators would have little incentive to work.

About Alex Gomez

Alex is a professional writer based in the U.S. focused on the blockchain industry. With years of experience, he contributes to some of the most recognized publications such as Yahoo, ONE37pm, and others. He previously worked for Gary Vaynerchuk as his NFT editor before going all-in on Cyber Scrilla.

1 thought on “How to Cancel A Pending MetaMask Transaction (2023 Guide)”

  1. Pingback: Is MetaMask Safe? (+ Best Tips to Keep Your Wallet Secure) – Cyber Scrilla

Comments are closed.