> For the complete documentation index, see [llms.txt](https://shoppa.gitbook.io/knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shoppa.gitbook.io/knowledge-hub/api-documentation/xml-structure/product/deleting.md).

# Deleting products

Sometimes you need to delete existing products or parts of a product, or you want to make sure any existing information is removed and not merged with the new information. Below we describe the different approaches you can use to solve this.

## Deleting a text field

You delete a product field by simply assigning it as an empty field.

Lets say we want to delete the *infoshort* field we added in *Adding a new text field*. We can do that by sending the following xml:

```markup
<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
    <texts>
        <text languageCode="en-GB">
            <field name="infoshort" />
        </text>
    </texts>
    </product>
  </products>
</mediablob>
```

Note however that in case this product was overloaded from another customer node, the original text will now be visible again. If you actually want the field to be empty, regardless of what has been defined at a higher level, you need to write an empty space to the field, like this:

```markup
<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
    <texts>
        <text languageCode="en-GB">
            <field name="infoshort"> </field>
        </text>
    </texts>
    </product>
  </products>
</mediablob>
```

*The space inside the field content is mandatory here. If the field is empty the original content will be visible again.*

## Deleting language support

To remove an entire language from our example product, we add a `<text/>` section with the attribute `delete="true"`:

```markup
<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
    <texts>
        <text languageCode="en-GB" delete="true" />
    </texts>
    </product>
  </products>
</mediablob>
```

There is no reason to add text fields to a deleted `<text />` section since the import will simply ignore them.

## Replacing all texts for a language

If you want to replace all texts for a specific language and make sure there are no legacy fields left behind, you need to write a delete-section followed by the new `<text />` section:

```markup
<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
    <texts>
        <text languageCode="en-GB" delete="true" />
        <text languageCode="en-GB" productName="Champagne glass" brand="Orrefors">
            <field name="sashort">Exclusive Twin-pack, the perfect wedding gift.</field>
        </text>
    </texts>
    </product>
  </products>
</mediablob>
```

*Make sure the* delete *comes first, or your newly added texts will be deleted too!*

## Deleting an entire product

Sometimes you want to delete an entire product, with all texts, codes and picture references. This is done with the following xml:

```markup
<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1" delete="true" />
  </products>
</mediablob>
```

As before, if the product is owned by another customer, the product will still be visible with its original content.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://shoppa.gitbook.io/knowledge-hub/api-documentation/xml-structure/product/deleting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
