---
title: Rejecting items
slug: '58'
canonical_url: https://docs.coveo.com/en/58/
collection: index-content
source_format: adoc
---
# Rejecting items

You have a Sitemap [source](https://docs.coveo.com/en/246.md) in which you have [configured web scraping](https://docs.coveo.com/en/mahe0350.md) to add a [metadata](https://docs.coveo.com/en/218.md) field named `section` on your [items](https://docs.coveo.com/en/210.md).
You write a pre-conversion [indexing pipeline extension (IPE)](https://docs.coveo.com/en/206.md) to reject items whose `section` metadata value is `internal`.

```python
def get_safe_meta_data(meta_data_name):
    safe_meta = ''
    meta_data_value = document.get_meta_data_value(meta_data_name)
    if meta_data_value:
        safe_meta = meta_data_value[-1]
    return safe_meta
​
section = get_safe_meta_data('section').lower()
​
if section == 'internal':
    document.reject("Section metadata value is internal.")
```

> **Note**
>
> This example rejects matching items and surfaces a rejection reason in the rejected item's message.
> Don't use `log()` to record the rejection reason for this case, because rejected items don't surface standard extension log output in the **Log Browser**.
> See [Log messages from an indexing pipeline extension](https://docs.coveo.com/en/140.md).

