# Prevent macro execution after saving

**URL:** <https://community.developer.atlassian.com/t/prevent-macro-execution-after-saving/54221>\
**Category:** Confluence Server\
**Tags:** macro, confluence-data-center, confluence-server\
**Created:** [December 7, 2021, 12:00pm UTC](https://community.developer.atlassian.com/t/prevent-macro-execution-after-saving/54221 "2021-12-07T12:00:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LuiseFrenzel](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@LuiseFrenzel](https://community.developer.atlassian.com/u/LuiseFrenzel)\
**Post date:** [December 7, 2021, 12:00pm UTC](https://community.developer.atlassian.com/t/prevent-macro-execution-after-saving/54221/1 "2021-12-07T12:00:25Z")

</div>

Hi there,  
I’ve developed a Confluence xhtml-macro (Server/DC). After saving the page with the configured macro it renders the macro and the execute-Method is called. But I only want the macro to be executed on page view, not page updated. Is there a possibility to prevent the execution/rendering after saving page (and macro)? Or a possibility in the execute-Method to distinguish if execute is called by page saving or viewing? I don’t think so but maybe someone has an idea.

Thanks in advance!
