# How hide calendar menu item

**URL:** <https://forum.mautic.org/t/how-hide-calendar-menu-item/16035>\
**Category:** Product Support\
**Created:** [September 11, 2020, 6:16am UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035 "2020-09-11T06:16:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 11, 2020, 6:16am UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/1 "2020-09-11T06:16:16Z")

</div>

**Your software**  
My Mautic version is:3  
My PHP version is: 7.2.33

**Your problem**  
My problem is: I want to be able to hide the calendar. I am setting up a client role and want to hide certain aspects. Role permissions do not cover calendar. And then users can see other users scheduled and upcoming emails. Alternatively, if anyone knows how to solve that issue so a user only sees their own calendar entries.

These errors are showing in the log:

Steps I have tried to fix the problem:

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [October 7, 2020, 8:20pm UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/2 "2020-10-07T20:20:16Z")

</div>

@robm I have been trying to do this, also. I’m unclear what the point of the calendar even is as it seems to show a massive amount of ‘system events’ that are not particularly useful to a marketer. I am currently trying to hide it via css, so far unsuccessfully. If I figure it out, I’ll post it back here.

Hiding unwanted features, and changing labels for others would be huge.

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [October 8, 2020, 5:56am UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/3 "2020-10-08T05:56:15Z")

</div>

I have also been hunting via CSS, please share if you find the solution as will I.

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [October 11, 2020, 12:39am UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/4 "2020-10-11T00:39:10Z")

</div>

@robm I have found a way to do it. Not sure if its the _recommended_ way, but it works.

Two-step process:

1. Create a new .js file in media/js, like ‘myscript.js’

Inside that script put this line:

```
window.onload = function() {
  document.getElementById("mautic_calendar_index").style.display = "none";
  document.getElementById("mautic_message_index").style.display = "none";
};

```

1. Now, open app/bundles/CoreBundle/Views/Default/head.html.php and put this just before the closing tag:

`<script src="/media/js/myscript.js"></script>`

You are just calling a script from the ‘head’ code that waits until the HTML of the page is loaded and then identifies the HTML element by its ID and sets a css style of display:none;

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [October 11, 2020, 12:52pm UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/5 "2020-10-11T12:52:00Z")

</div>

Champion! It worked.

One edit on instructions. If you name the js script “myscript.js” then use that name in the head.html file script addition. ie replace “headstart” with whatever you named your file.

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [October 12, 2020, 3:43pm UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/6 "2020-10-12T15:43:14Z")

</div>

Great! Thanks for the correction. I just edited the post to be consistent.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [November 18, 2020, 11:37am UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/7 "2020-11-18T11:37:59Z")

</div>

> [@ericgr](#):
>

I love this little hack, have used it on a number of instances already as the calendar feature is not the best in Mautic unfortunately.

Do you think it is possible to hide the Components menu link for users that do not have permissions to access any of the components module ?  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/61730a39afff8c191cd9f70675eb7b3e28058544.png)

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [July 23, 2021, 6:34pm UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/8 "2021-07-23T18:34:56Z")

</div>

Hi @mikew - sorry for the long delay. Have you figured out a way to do this? Off of the top of my head, it seems difficult because you would need to tap into however Mautic authorizes roles and access and then utilize that in the javascript script to hide/show bases on the authorization. I have no idea how to do that! This was more of a ‘broad stroke’ approach that just kills the calendar for everyone.

---

<div class="post-metadata">

**Author:** ![rahul.shinde](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rahul.shinde/32/10438_2.png) [@rahul.shinde](https://forum.mautic.org/u/rahul.shinde)\
**Post date:** [October 17, 2022, 7:11am UTC](https://forum.mautic.org/t/how-hide-calendar-menu-item/16035/9 "2022-10-17T07:11:33Z")

</div>

One way is to write a custom code and hide it. Here are the pointers to do so,

- Listen to the event `CoreEvents::BUILD_MENU` in your custom plugin
- And add this `$bundles['MauticCalendarBundle']['config']['menu']['main']['items'] = [];` to the method. Or `$bundles['MauticCalendarBundle']['config']['menu']['main']['items']['mautic.calendar.menu.index']['access'] = '<your-permission-name>';`

This will remove the
