Google Sheets has no built-in menu option to delete an image by its URL, so you need a short Apps Script that finds the image and removes it. The practical answer is: images added with Insert > Image > Image in cell can be cleared by script because they live in a cell; floating images placed over cells cannot be targeted by URL at all, and the script cannot remove them. Below is the working method for in-cell images, plus what to do when the image will not go away.

What You'll Need

  • A Google account with edit access to the spreadsheet.
  • The spreadsheet open in a desktop browser. The Apps Script editor is not available in the Google Sheets mobile app, so do this step on a computer.
  • The exact image URL, copied in full. A URL that differs by even one character will not match.
  • The image must have been inserted as an in-cell image, not as a floating image over the grid.

Step-by-Step

  1. Open the spreadsheet in a desktop browser and confirm the image type. Click the image once. If a small selection handle appears and the cell behind it is highlighted with the image sitting inside the cell border, it is an in-cell image and this script can remove it. If the image floats freely over several cells and you can drag it anywhere, it is a floating image and the script will not find it.
  2. Copy the image URL. Right-click the image and choose the option to open or copy the image address, or read it from the formula bar if the cell contains an =IMAGE("…") formula. Paste it somewhere safe so you can compare it later.
  3. Open the script editor from the spreadsheet menu: Extensions > Apps Script. Menu labels can differ slightly by version and region, but this path is standard on desktop.
  4. Delete the placeholder code in the editor and paste a function that loops through the used range, checks each cell for an in-cell image, compares the image URL to your target, and clears the cell when it matches. The key calls are getImages() on a range, getUrl() on the returned image, and clearContent() on the cell. Keep the target URL in a single constant at the top so you only edit one line.
  5. Save the project with Ctrl+S (or Cmd+S on a Mac) and give it a name you will recognise.
  6. Run the function once by selecting it in the function dropdown and pressing Run. The first run asks for authorisation: choose your account, click through the consent screens, and allow the script to access the spreadsheet. This is normal for any Apps Script bound to a file.
  7. Return to the spreadsheet tab and check the result. The matching image should be gone and the cell empty. If nothing changed, the URL did not match exactly or the image is a floating image.
  8. Optional: instead of running manually, add a trigger from the clock icon in the Apps Script sidebar so the cleanup runs on a schedule. Only do this if you are sure you want the image removed automatically.

Common Mistakes

  • Targeting a floating image. Images inserted with Insert > Image > Image over cells are not attached to any cell, so no URL lookup will find them. Delete these by clicking the image and pressing Delete or Backspace.
  • URL mismatch. Extra spaces, a shortened link, or a different size parameter on the end of the URL all break the match. Compare the copied URL character by character with the one in the sheet.
  • Clearing the wrong thing. A script that clears the whole cell also deletes any text or formula in it. If the cell holds an =IMAGE() formula you want to keep, adjust the script to blank only the formula instead of clearing the cell.
  • Running on the wrong sheet. A loop over the active sheet only touches that tab. If the image is on another tab, the script reports success but changes nothing.
  • Authorisation refused. If you dismiss the consent screen, the script cannot read the sheet and will fail silently or throw an error.

Tips

  • Test on a copy of the spreadsheet first. Use File > Make a copy so a mistake cannot damage the original.
  • Log the URLs the script finds before deleting anything. Writing each match to the execution log lets you confirm the right image is being targeted.
  • If you have many images, restrict the loop to the columns that actually hold them rather than the entire used range; it runs faster and is less likely to touch unrelated cells.
  • Keep the target URL in one clearly named constant. Future edits then take seconds.
  • Remember that removing an in-cell image does not delete the underlying file at that URL; it only removes the display from the sheet.

Troubleshooting

If the script runs without errors but the image remains, work through these checks in order. First, confirm the image type again by clicking it; floating images must be deleted manually. Second, re-copy the URL directly from the image and paste it into the script constant, replacing the old value entirely. Third, confirm the script is looping over the correct tab by checking the sheet name in the code against the tab name at the bottom of the window. Fourth, open the execution log and look for the URL list; if the target URL never appears, the comparison is failing.

If the script throws an authorisation or permission error, reopen Extensions > Apps Script, run the function again, and complete the consent flow. If it still fails, remove the script's access from your Google Account permissions page and authorise again. If the editor will not open at all, reload the spreadsheet in a desktop browser and try once more; the mobile app cannot run this step.

If you accidentally cleared a cell that held other content, use Ctrl+Z (or Cmd+Z) immediately. Undo history is limited, so act quickly.

Frequently Asked Questions

Can Apps Script delete a floating image by its URL?

No. Floating images are not tied to a cell, so there is no URL property to match against. Delete them by selecting the image and pressing Delete.

Does removing the image delete the file it points to?

No. The script only changes the spreadsheet. The image file at that URL is untouched.

Can I run this from the Google Sheets phone app?

No. The Apps Script editor is desktop-only. You can view the result on mobile after running the script on a computer.

Why does the script find nothing when the image is clearly there?

Almost always a URL mismatch or the wrong sheet tab. Re-copy the URL and confirm the script targets the tab that holds the image.

Will the script remove every image with that URL?

Yes, if it loops the whole sheet. If you want only one removed, narrow the range the script checks.

Is it safe to authorise the script?

Only if you wrote it or trust its source. A bound script can read and edit that spreadsheet, so review the code before granting access.