> For the complete documentation index, see [llms.txt](https://doc.dastra.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.dastra.eu/en/features/cookies/integration/quickstart/wordpress.md). Agents can also search and read this documentation through its [MCP server](https://doc.dastra.eu/~gitbook/mcp).

# Wordpress

Learn how to integrate the Dastra cookie banner on a WordPress website.

## Install the Dastra plugin

The Dastra plugin is the recommended method: theme updates do not overwrite it.

1. In the banner, open the **Installation** section and click the **Wordpress** card.
2. Click **Visit the plugin page**, or search for the "Dastra" plugin in the plugins list of your WordPress administration. You can also download the plugin from this window and install it manually.
3. Install and activate the plugin.
4. In WordPress, open **Settings** > **Dastra** and click **Link with Dastra** to link the plugin to your banner.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2Fgit-blob-29b4046f66b6cc20eef0c407fe510ed69c80a6c6%2Fcookies-wordpress-1.png?alt=media" alt="The WordPress window of the Installation section with the link to the plugin"><figcaption><p>The "Wordpress" card of the Installation section</p></figcaption></figure>

## Or paste the code in the theme

If you cannot install a plugin, paste the banner code in the theme. A theme update overwrites this change: apply it in a child theme instead.

1. In the **Installation** section of the banner, click the **JavaScript** card and copy the code.
2. In the administration of your WordPress site, click **Appearance**, then **Theme Editor**.
3. Select the `footer.php` file, then insert the code just before the `</body>` tag.

![The WordPress theme editor with the footer.php file open](https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2Fgit-blob-fe5440fa4ac7e4b6ac2f6eabf71f3a71b9610204%2Fcookies-wordpress-theme-editor.png?alt=media)

4. Click **Update File**, then refresh the page of your website. The banner appears.

Also add a button that reopens the banner, as described in [Quick start](https://doc.dastra.eu/en/features/cookies/integration/quickstart.md#reopen-the-banner-from-a-button).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.dastra.eu/en/features/cookies/integration/quickstart/wordpress.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
