---
title: "Delete Code Snippet Ability: Permanently Remove a Snippet in WordPress"
url: https://nexterwp.com/docs/nexter-ability-delete-snippet/
date: 2026-05-29
modified: 2026-05-29
author: "sandip patel"
description: "The nexter/delete-snippet ability permanently deletes a Nexter Extension code snippet by ID. This action removes the snippet file and cannot be undone."
word_count: 208
---

# Delete Code Snippet Ability: Permanently Remove a Snippet in WordPress

## Key Takeaways

- nexter/delete-snippet permanently deletes a Nexter Extension code snippet by ID and cannot be undone.
- nexter/list-snippets must be used to verify the snippet ID before calling nexter/delete-snippet.
- The ability removes the snippet file from the filesystem and updates the snippet index.

The **nexter/delete-snippet** ability permanently deletes a Nexter Extension code snippet by ID. It removes the snippet file from the filesystem and updates the snippet index. This action cannot be undone. Always verify the snippet ID using **nexter/list-snippets** before calling this ability.

## Key Takeaways

This is a destructive action. Deletion cannot be undone once the ability executes.

The ability removes the snippet file from the filesystem and removes it from the snippet index.

Always use **nexter/list-snippets** first to confirm the correct snippet ID before deleting.

If you only want to stop a snippet from running, use **nexter/toggle-snippet** with status=0 instead.

## Required Setup

You need a valid snippet ID from **nexter/list-snippets** before calling this ability. The Code Snippets feature must be enabled in Nexter Extension settings.

## Parameters

**id** (string, required) is the snippet ID to delete. Get valid IDs from **nexter/list-snippets**.

## What It Returns

**success** (boolean) confirming the snippet was deleted.

**message** confirming the deletion result.

## When to Use This Ability

Permanently remove a snippet that is no longer needed and you are sure you will not need to recover.

Clean up test or temporary snippets after development is complete.

## Related Documentation

nexter/list-snippets: Find the snippet ID before deleting

nexter/toggle-snippet: Disable a snippet without deleting it

nexter/get-snippet: Review a snippet code and settings before deciding to delete