How to cancel a pending ethereum transaction with MetaMask
Having a pending transaction can be quite annoying and usually happens when the network is heavy loaded and the fees are sky rocketing. Your transaction may have a too low gas fee and miner are just ignoring it to prefer others transaction with higher fees.
This result in you being stuck because until that transaction is resolved you cannot send any other transaction. Annoying right ?
Let’s dive right in on how to fix this !
Gather all the informations we need
Prerequisite
This tutorial is about using MetaMask to cancel the pending transactions so you need to have it.
If you don’t have MetaMask installed on chrome, here is the official address to do so.
Etherscan
The first step is to go on etherscan and paste the tx hash of your pending transaction. You can also paste your ethereum address and will be able to find all your pending transactions.

Find the oldest pending transaction, click on it and then click on Click to see More ↓ to get the Nonce number of that transaction.

All the transactions of an ethereum address have a nonce number that increment after each transaction.

Now the concept behind cancelling a pending transaction is to actually send a new transaction with the same Nonce but with a higher fees that the miner will verify and confirm. When this will be done, the previous pending transaction with the same nonce will simply be cancelled and forget by the network because only unique nonce transaction per ETH address can exists.
You should have those informations for going to the next phase :
- Your Ethereum address
- The Nonce of your blocked pending transaction
- MetaMask installed and running with your Ethereum address
How can I send my own custom transaction
The basic configuration of MetaMask doesn’t allow us to use custom Nonce, but you can enable that option in the configuration.
Enabling the custom gas settings and custom nonce
Click on this button

The go into the settings

Now click on Advanced
I suggest to enable both Advanced gas controls and Customize Transaction nonce
Sending a custom transaction to fix the pending tx
Once that’s done, quit the configuration and now click on the SEND button.

Paste your ETH address, and then add 10 GWEI to the transaction fee gas price to be sure you are above the network average Gas Price so this transaction won’t be stuck pending as well. Always verify on Eth Gas Station and use a Gas Price above the FAST recommendation. Leave Gas Limit as it is (21000).
Click on Next when you are done.

In this screen you should be able to set your own custom Nonce if you enable it properly in MetaMask config as explained in the beginning of that article. Write down the Nonce of your blocked pending transaction and click on Confirm.

MetaMask will ask you to sign your transaction and how will depend on if you are using a Ledger or something else. Once you did sign it, the transaction will be sent and if you were above the FAST Gas Price recommendation from Eth Gas Station website it should be confirmed in less than a minute and your blocked pending transaction should now be cancelled.
If you had other pending transaction after that one that are still blocked after this, you will need to repeat the process for each one of them, from the oldest to the newest until you eventually cleared your whole pile of pending transactions.
How can I prevent that from happening again
Regularly keep an eye on the Eth Gas Station website to know the current average Gas Price, and don’t always trust pre configured gas price from MetaMask. If you are doing a transaction that is very important, you can always Edit the Gas Price MetaMask is choosing for you and set it to fast, or even a custom one that you decide.
Отменяем зависшую транзакцию в Metamask
Почти каждый день я вижу в чатиках как криптаны сталкиваются с проблемой зафейленной транзакции, ибо из-за неё остальные транзакции встают в очередь и невозможно что-то с этим сделать, пока первая ( зависшая ) транзакция не отправится.
В этой небольшой статье я расскажу как это можно пофиксить!
Из-за чего вообще фейлится транзакция? Всё дело в том, что вашу транзакцию перебили по GWEI и те, кто поставили GWEI выше — попали в блок, а вам остается ждать пока газ не понизится, т.к когда вы отправляли газ был меньше. Такие вещи часто происходят: при покупке вторички хайповой коллекции на OpenSea или при минте NFT, а также при клейме токенов. Транзакцию можно ускорить, но она также не всегда проходит, но и можно отменить. Остается два варианта: 1. Сидим и ждем пока gwei опустится до тех пределов по которым вы выставляли транзакцию, но ждать придётся полчаса/час/сутки и тогда ваша транзакция отправится.
2. Мы можем ничего не ждать отменить транзакцию за 1 минуту.
Для этого переходим в наш Metamask -> Настройки -> Дополнительно
Далее переходим на https://etherscan.io и видим нашу зависшую транзакцию со статусом Pending.
Жмем на хэш транзакции и в открытом окне опускаемся ниже , нас интересует раздел — Click to show more
Смотрим на Nonce — это номер нашей транзакции, в моём случае это 1, у вас же это будет другое число, и запоминаем его.
Переходим в наш Metamask и отправляем 0$ на любой кошелек, например на наш второй счёт, или на кошель биржи, это не важно.
Жмем сохранить и отправляем.
Теперь заходим обратно на etherscan, ждем примерно минуту и смотрим, что наша транзакция отменилась ( деньги за газ списались)
Вот и всё, на практике вы быстро научитесь и сможете отменять транзакции за 1 минуту.
еще больше инфы в моём канале вижн воркера , спасибо за уделённое время и удачи =)
How to Unstick Stuck Transactions in MetaMask
![]()
If you’re a MetaMask user and have found yourself pulling your hair out with anxiety when a transaction seemingly pauses forever, this post is for you.
In this post, you’re going to learn why transactions may seemingly get stuck. And you’ll learn some tips on how to clear them from your transaction queue so you can get back to smooth sailing. If one transaction is stuck, then any transactions you submit after will be stuck too because your personal wallet has to go in chronological order.
This article is written from the perspective of the polygon network, but the same principles apply to other networks. You’ll just need to use a different network explorer e.g. etherscan, avaxscan, ftmscan, bscscan, etc.
Getting your Transaction ID
First, you need to copy the transaction ID of the stuck transaction to your clipboard. This will be handy in later steps as you will use it to search for your transaction details on the block explorer.
- Open your MetaMask wallet and go into the activity session. There will be a list of your recent transactions. When you find the one that is stuck, left click with your mouse anywhere inside the transaction field.
2. A window will open with the transaction details. When you click the button indicated below, the transaction ID will be copied to your clipboard.
Why is my transaction stuck?
If you think you understand why your transaction got stuck, you can skip ahead to the “Fixing Stuck Transactions” section. However, this section contains valuable information you may not already know. A transaction can be ‘stuck’ for many different reasons. It could be from low gas price, network congestion, running on empty, or software problems with MetaMask itself.
Low Gas Price
By far, the most common reason a transaction gets stuck or takes longer than usual is low gas price.
Blockchains require gas fees to process transactions and use a bidding system based on gas price to prioritize the transactions. Provide a higher gas price with your transaction? The faster your transaction will be completed compared to everyone else’s since it will get bumped up in the queue.
The gas price that you may have used two hours ago when the network was uncongested, may not be enough gas now if the network activity has increased since then. Because of the bidding system, other people may now be paying a higher gas price and the network will prioritize their transactions ahead of yours.
Since most dapps auto-suggest gas prices for you, one reason your transaction may be stuck is that the dapp suggested a gas price that was too low in an attempt to save you money.
A decentralized application (dapp) is an application built on a decentralized network that combines a smart contract and a frontend user interface. KogeFarm.io is an example of a dapp.
Before initiating a transaction the dapp you are using will provide a gas limit and suggested gas price for your transaction. The gas limit is usually spot on because this is basically hardcoded into the contract based on the complexity of the task. Sending a token? That’s easy and requires a lower gas limit. Interacting with a smart contract that is also sending data? That’s more complex and requires a higher gas limit. Gas limit is affected much less by network congestion and therefore is easier to estimate. You normally don’t have to worry about changing this value.
Gas price on the other hand? Recommended gas prices are constantly changing. Spend a minute watching Polygon Gas Tracker’s recommended gas price and you’ll see the value for a fast transaction change frequently.
This is where your dapp may have underestimated for you. Should they try and save you money but risk giving you a slow transaction by using a lower gas price? Or should they always use the gas price recommended for a fast or rapid transaction and risk potentially overcharging their users? At KogeFarm.io we always suggest a fast gas price consistent with the Polygon Gas Tracker’s “fast” transaction.
If the dapp opted for the prior option to save you money, you may get a slow stuck transaction. Perhaps the dapp even used the fast suggestion from the gas tracker website, but the network gas prices were spiking rapidly at the time. This may still cause your transaction to get behind many others and due to network congestion, not complete in a timely manner.
Take a look for yourself, if you go over to the Polygon Pending Transactions, you will probably see more than 100 transactions waiting to go through.
If you want to skip to the front of this line, you must set a higher gas fee than all these other transactions. This way, the miners will validate your transaction ahead of the others that are pending.
If you don’t provide a high enough gas price, there may be an eternally long line of people willing to pay more for their transaction than you. Your transaction will sit at the bottom of the queue even as new transactions come through and constantly cut in line in front of you.
So how do you know what gas price to provide to speed up your transaction and get it complete? Keep reading and we will explain that after mentioning a few other reasons for failed transactions.
Running On Empty
Another reason a transaction may get stuck or fail is from running too low on the gas supply in your wallet. Before you initiate a transaction, your wallet will check that you have enough gas to cover the costs for that specific transaction. However, if after you initiate the transaction, but before it completes, a prior transaction completes and uses all the available gas in your wallet you will get a failed transaction. You are running on empty. Do yourself a favor and stop trying to keep the absolute bare minimum amount of gas in your tank. This is like trying to drive another hundred miles AFTER the gas light in your car came on. Keep a little more gas in your wallet (on Polygon this is the MATIC token) and you’ll avoid this problem.
MetaMask Problems
Although less common, your MetaMask wallet may also be the cause of a failed transaction.
If you keep getting failing errors like the screenshot above, even after you attempt to increase the gas fee, you must contact their support team for a better investigation into your problem. Make sure and use the official support page. Scammers love looking for people who need “help.”
Fixing Stuck Transactions
We recommend trying the following suggestions in the order they are written since they progress from easy to hard and the first few will solve 98% of the problems. If the first few don’t work? Congrats, you get to read all the way to the bottom.
Speeding up a Transaction
If you’re new to the cryptocurrency world, you may not realize you can speed up transactions. Go to your transaction queue on MetaMask, click speed up, provide a higher gas price, then resubmit. This allows your transaction to get broadcasted again, with the same nonce (nonce is the fancy term for your transaction ID) and the new higher gas price that you have set. You can try increasing the gas limit as well, but increasing the gas fee is usually more important since it is what sets your place in line.
On MetaMask you click “save” after clicking “speed up” to submit the new gas price.
But what should you provide as the gas price? Feeling lazy and on a cheap network? Just double it. Be careful though, this could kill your wallet if you are on an expensive network like the Ethereum network. A better and more accurate way to know what to put into the gas price field is by checking the gas station prices. Each network typically has a gas station network that reports on gas prices needed for Standard, Fast, and Rapid transactions.
I typically choose fast or rapid. Sometimes if I’ve already tried to speed up a transaction once using “fast” or “rapid” and it still isn’t going through, I’ll set the gas price even higher to force it through.
Canceling a transaction
If you don’t want to speed up your transaction, you can cancel it.
In-app cancellation
The simplest way to cancel a transaction is by clicking Cancel, as in the screenshot below.
Canceling a transaction is still technically a transaction so it requires its own gas limit and gas price. Make sure you provide a high enough gas price for it to go through as shown in the previous section of this article.
However, this method is ONLY functional if the transaction is still pending on the network. If MetaMask displays the transaction as pending, but it’s not actually pending (as shown by Polygon Scan) then it’s time to reset MetaMask.
To find out if your transaction is still pending, access Polygon Scan (or the appropriate network scanner for the network you are on) and paste your Transaction ID into the field below. We describe how to get your transaction ID in the first section of this article.
The transaction details will be shown. Check the Status field. It will display “Pending” if your transaction didn’t succeed. Otherwise, it will show “Success”, like this one.
It takes a few minutes for Polygon Scan to show details like Pending or Success, and you may have to wait a little bit for the block explorer to process the details. But since you are reading this article, you’ve probably already waited a sufficient period of time. Time to reset MetaMask.
If you’ve already attempted to speed up the transaction AND it still says pending on the block explorer, skip over this section to the “Custom Nonce Method”
Resetting your MetaMask
This method should be done if your transaction is pending in your wallet, but is not present on the block explorer, as shown above.
If your transaction is not displayed, you may start the process of resetting your wallet.
Before resetting your wallet, you should know that your funds are still safe. This process only resets the wallet’s history and does not require you to re-enter your seed phrase. It’s similar to clearing your browsing history or cache on your internet browser.
- With your MetaMask wallet opened, click on the profile picture on the top right and select Settings.
2. You will see the Settings list in front of you. Click on the Advanced section. After that, click on the third option: Reset Account.
MetaMask will pop up a warning message, assuring you that the balances in your account will not change, that this process only resets the wallet’s history activity and does not require you to re-enter your seed phrase. Phew!
Click Reset.
Now that your wallet has been reset and there are no more pending transactions, you can attempt your transaction again.
Custom Nonce Method
Nonce essentially means your transaction ID. In more technical terms a nonce is an abbreviation for “number only used once,” which is a number added to an encrypted block in a blockchain. Each time you send a transaction, the nonce value increases by 1, and it can go on and on indefinitely, like a rising counter. This nonce value prevents double-spending, as the nonce will always specify the order of transactions. If you want to go deep into this subject, take a look at this article about it.
In the Custom Nonce Method, we are going to create a new transaction with the same nonce as the transaction you want to cancel. The old pending transaction will be cancelled by the network because it is impossible for 2 transactions to exist with the same nonce.
Before we start, we must enable the Customize transaction nonce. This action will allow you to manually input the transaction nonce (normally it just auto increments for you).
- Open your MetaMask wallet, go to Settings, and then Advanced. Scroll down until you see the Customize transaction nonce option and turn it on.
2. To find out the transaction nonce you want to cancel, go to Polygon Scan and past the Transaction ID in the search field.
3. Once you are there, scroll down the page and Click to see more. The nonce field will appear, displaying the nonce value.
Ignore the second number in grey, the first number (the one underlined in the photo above) is the one you are after. Another way to find the nonce is by clicking on the pending transaction in MetaMask, this displays the transaction details along with the nonce value. Now that you have identified the nonce value, the final step is to send a new transaction with the same nonce to kick the old transaction out of the system.
This new transaction will essentially be a dummy transaction (sending nothing important, going nowhere important), but the key here is that it uses the same nonce value. This will clear out the stuck transaction as only 1 transaction can exist with the same nonce.
4. Set up your dummy transaction by sending 0 Matic to yourself. Paste your wallet address in the first field. To make sure this new transaction will succeed, increase the gas fee to the fast or rapid price as explained previously. Click Next.
5. Then, set the value of the custom nonce field with the same nonce of the pending transaction. This is where you change manually the new transaction nonce, getting the old transaction cancelled by the network. Click Confirm.
Wait a few minutes for the transaction to be processed and go back to your wallet activity tab. Your old pending transaction should now be cancelled.
Once you’ve cleared out all stuck transactions (repeating one or more of the processes above many times if needed!) you are good to go!
Oh, and don’t forget to turn off custom nonce. It just makes it easier if MetaMask sets that value for you.
Conclusion
Now you don’t have to worry anymore when your transactions are stuck, there are several ways to fix this inconvenience as we saw here today. Again, never commit the sin of using low gas prices! Just kidding, you can use low gas prices. Just be prepared to wait.
If you have any other questions, please stop by the KogeFarm Telegram or Discord communities, where you’ll always find someone willing to help you out.
Ускорение транзакций
Подождите, пока сеть будет готова обрабатывать транзакции по этой цене.
Нажмите кнопку с надписью "Ускорить"Это позволит вам повторно отправить ту же транзакцию, но с более высокой комиссией за газ, что должно ускорить обработку транзакции.
Способ 1: Отмена в приложении
Если вы еще этого не сделали, просто выберите Отмена, чтобы отменить транзакцию. Обратите внимание, что отмена может быть предпринята только в том случае, если транзакция все еще находится на рассмотрении в сети.
Способ 2: Пользовательский одноразовый номер
Обратите внимание, что при использовании описанного ниже метода вам нужно будет работать в обратном направлении от самой старой ожидающей транзакции в очереди, которую вы хотите отменить. Например, вы не должны пытаться отменить транзакцию с одноразовым номером 10 до отмены транзакции с одноразовым номером 9.
1. Включите Customize transaction nonce в дополнительных настройках вашего кошелька MetaMask. Убедитесь, что Advanced gas controls также включены, так как это позволит вам манипулировать газом, который вы платите, и убедиться, что ваша транзакция отмены будет обработана раньше, чем оригинал, который вы хотите отменить.


2. Отправьте новую транзакцию. В новой транзакции вы можете отправить средства СЕБЕ, имея в виду свой публичный адрес MetaMask. Заполните «Пользовательский одноразовый номер» тем же одноразовым номером, что и транзакция, которая все еще находится на рассмотрении:

Теперь нажмите "Изменить" рядом с «Комиссия за газ». Чтобы убедиться, что ваш запрос на отмену будет принят в приоритетном порядке, чем исходная транзакция, вам нужно будет заплатить больше за газ.
Установите свой лимит газа, сравнимый или немного превышающий исходную транзакцию, а Max priority fee как минимум на 10 % выше (в gwei), чем GAS FEE от исходной транзакции, которая находится на рассмотрении (например, если эта транзакция имела комиссию за газ в размере 30 Gwei, пожалуйста, установите MAX PRIORITY FEE в транзакции замены/отмены на 33-35 Gwei).
Чтобы определить соответствующие gas fees, посетите https://stats.avax.network/dashboard/c-chain-activity/, чтобы узнать, каковы последние минимальные и максимальные gas fees, поскольку сетевая активность может варьироваться в зависимости от дня, времени и текущих событий.
Как правило, для того, чтобы эти транзакции были успешными, лучше всего установить MAX FEE как минимум на 30% выше, чем транзакция, которую вы отменяете/заменяете (например, если ваша предыдущая MAX FEE была установлена на 150 Gwei, то стоит выставить что-то в районе 200 Гвэй).
Способ 3: Сбросить счет
В расширении щелкните значок учетной записи в правом верхнем углу. На мобильном устройстве коснитесь иконки гамбургера в левом верхнем углу, чтобы открыть главное меню.
Прокрутите вниз и нажмите Сбросить счет
Обратите внимание, что мы официально не оказываем поддержки по вопросам, связанным с Metamask. Мы просто предоставляем вам информацию о поддержке MetaMask, предоставленную им самим. Для получения официальной поддержки посетите справочный центр Metamask.