I would like to change the text and button value of the Mage2's default cookie policy popup.

See how it looks now: https://i.stack.imgur.com/hWWmp.jpg

I would like it to read some different text and have a different button text.

How would I do this?


3 Answers 3


Try following:

Copy file to your frontend theme and update text as you want.


  • how to do it by custom module can u please provide me the steps plz Feb 4, 2020 at 13:40

You can find text in below template location :


To change that you should copy notices.phtml file and save this in your theme folder and update as you want.


for future coders: you need to override the notices.phtml file in your custom Module or custom theme and to do that you need two steps:

  1. in view/frontend/layout/default.xml you reference the cookie container and the notice block ,and through the method setTemplate, you specify your own new notices.phtml like this:

                <referenceBlock name="cookie_notices">
                    <action method="setTemplate">
                        <argument name="template" xsi:type="string">
         Vendor_CustomModule::folder name/notices.phtml
  2. now you can copy the notices.phmtl contents from the Magento Module "module-cookie/view/frontend/templates/html/notices.phtml" into your own overriden notices.phtml and change the text and button as you wish.

P.S. as your setting the template in default.xml the starting point is your templates folder, so if we take as an example the magento phtml file the folder name would be html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.