This is very little code snippet that will help you to hide some activity notification from the sitewide activity page. When someone joins in a group, we see a notification in sitewide activity page says, â€œSomeone joined the group ABCâ€.
This not that bad, but if your site is attacked by spam users, your activity feed will be flooded with spam notification. So why donâ€™t just hide it? Here is the code snippet:
You can add those codes in your functions.php in the theme, if you think your theme wonâ€™t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name â€˜mu-pluginsâ€™. If there is no folder in that name, then create a folder, name it â€˜mu-pluginsâ€™, create a file inside that, give any name you like and paste the code in there. You donâ€™t need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.
You can do the same for other notification type. If you donâ€™t know the type, in the above code just use:
You will get all the types that are coming in your activity field.