In some countries, the law requests websites to provide a way for users to opt-out of all tracking, in particular tracking cookies.
Matomo uses cookies to store some information about visitors between visits.

Disable cookies for all sites within Matomo

If you never want to make use of cookies in any of your sites, then you can simply disable cookies for all sites.

Disable cookies for a specific site when you are using Matomo On-Premise or Matomo Cloud

See also: List of cookies used by Matomo (Piwik).
It is easy to disable tracking cookies by adding one line in the Matomo Javascript code. Edit your Matomo Javascript code as follows:

[...]
// Call disableCookies before calling trackPageView 
_paq.push(['disableCookies']);
_paq.push(['trackPageView']);
[...]

If you are using Matomo for WordPress

Log in to your WordPress Admin Dashboard. Go to “Matomo Analytics -> Settings”. You will see the tracking settings page. To disable cookies enable the option “Disable cookies” and press “Save changes”.

If you are using Matomo Tag Manager

Using Matomo Tag Manager, you can disable tracking cookies by either of these solutions:

  1. in your Matomo Tag, you can check the option “Disable cookies” which will disable all first party tracking cookies for Matomo.
  2. or if you still want to use cookies if user gives consent, then you can create a “Custom HTML” tag, and insert _paq.push(['requireCookieConsent']); in this tag. You would also need to create a Trigger on “DOM Ready” (which will be executed first before the Pageview trigger). Then in your Custom HTML tag, set “Execute this tag when any of these triggers are triggered.” to “DOM Ready”.

Implications on data accuracy

Learn more how cookie affect data accuracy in our FAQ: When cookies are disabled by a visitor, how does it impact Matomo reports accuracy?

Implication on cookie consent banner and asking user for consent

You can avoid the analytics cookie consent banner by disabling all analytics cookies in your JavaScript tracking code (as per instructions above). Learn more about tracking analytics without consent or cookie banner

Essential non-analytics cookies that may still be created

Note: when cookies are disabled, there may still be a few essential cookies created in specific cases:

  • when you exclude yourself from being tracked using the cookie method or using the iframe opt-out method, Matomo will create a cookie piwik_ignore set on the domain of your Matomo server (a temporary short-lived cookie called MATOMO_SESSID will also be created).
  • when you’re asking for consent before tracking visitors, two cookies may be created: mtm_consent and mtm_consent_removed.
  • _pk_testcookie is also created without any identifier and is directly deleted (it is only used to check whether the visitor’s browser supports cookies)