# Block ID

<figure><img src="/files/2pbaZIZjsH1T7icFZ3ch" alt=""><figcaption></figcaption></figure>

The Block ID property gives a unique identifier to your block.

It can act as a named anchor. You can therefore create an anchor link that takes you to the desired element

It can also act as an identifier for Cwicly to allow targeting the block for specific actions

{% hint style="info" %}
The Block ID attribute must be unique to the page. A block can only have one Block ID.
{% endhint %}

## Find Block ID

* Select a block
* Open the Block Inspector
* Find ID field.

<figure><img src="/files/XdCXMUxnslKIdkOyoa4N" alt=""><figcaption></figcaption></figure>

* Click ID tab.
* The field will now show the Block ID.

<figure><img src="/files/T1div0RDVPgwqcM1eoUr" alt=""><figcaption></figcaption></figure>

## Create block ID

{% hint style="warning" %}
The Block ID for the selected block should always be unique. Multiple identical Block IDs in a page will invalidate your website.
{% endhint %}

Whenever you insert or create a block, a unique Block ID is automatically created and applied to the element.

That's it! Cwicly doesn't rely on user ID creation, preferring to have a unique ID created for every block.

## Modify block ID

{% hint style="info" %}
IDs must start with a letter

IDs should be descriptive

IDs must not contain space characters
{% endhint %}

Since IDs are specific to each block, modifying their name will have to be done via the block they are related to.

### Rename

* Select a block.
* Double click the Block ID name in the field.
* &#x20;Input new name as required.

{% hint style="info" %}
Make sure that the new name is unique.
{% endhint %}

<figure><img src="/files/Ef0VEuAWiJZL31I79VPT" alt=""><figcaption></figcaption></figure>

## Remove a block ID

Since Block IDs are bound to a specific block, removing that block will automatically remove the Block ID from your website.

{% hint style="info" %}
Make sure to remove any link that contains the block ID before removing it from your website.
{% endhint %}

## Remove Classes and IDs

The Remove Classes and IDs toggle ensures clean markup for optimised performance. There is no point in having both ID and class applied on markup if they are not being used or targeted (ID javascript and anchoring).

By default, Cwicly shows all classes and IDs but this the Remove Classes and IDs toggle can be toggled on from the Cwicly Advanced Settings. A class will automatically show when styles are applied to the block.

Global classes added are automatically updated without needing to refresh

* Open Cwicly Settings in the WordPress Dashboard.
* Find Cwicly Optimisations in the Advanced Settings tab.
* Toggle on Remove Classes and IDs.

<figure><img src="/files/xo8Mz8UqNSPP2oDbrry1" alt=""><figcaption></figcaption></figure>

## Show/Hide ID

A Show/Hide toggle is provided to allow you to have the class/ID appear on the frontend even if there are no styles applied to the block.&#x20;

This is because block classes and IDs don’t appear by default on the frontend.&#x20;

Only when styles have been added at the block level will the class will appear.&#x20;

If you already have styles applied, toggling the class won’t do anything.

* In the Block Inspector, navigate to the Block ID.
* To the right of the Block ID field, toggle on the "Dot".

<figure><img src="/files/xHl65AfTbor1eFv8Ks8K" alt=""><figcaption></figcaption></figure>

When it is toggled on, the dot becomes green.

An indicator next to ID indicates that the ID has been applied.

<figure><img src="/files/dOEdqHLzWHe3jFGoXhac" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.cwicly.com/cwicly/block-id.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
