# hubl condition when editing content

**URL:** <https://community.hubspot.com/t/hubl-condition-when-editing-content/10166>\
**Category:** Blog, Website & Page Publishing\
**Created:** [September 12, 2018, 10:14am UTC](https://community.hubspot.com/t/hubl-condition-when-editing-content/10166 "2018-09-12T10:14:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matttunney](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/matttunney/32/18373_2.png) [@matttunney](https://community.hubspot.com/u/matttunney)\
**Post date:** [September 12, 2018, 10:14am UTC](https://community.hubspot.com/t/hubl-condition-when-editing-content/10166/1 "2018-09-12T10:14:49Z")

</div>

Hi -

Is there a variable or function that I can call to prevent some scripts from running when a content editor is either editing or previewing a blog post or landing page.

Thanks

Matt

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [September 12, 2018, 1:43pm UTC](https://community.hubspot.com/t/hubl-condition-when-editing-content/10166/2 "2018-09-12T13:43:48Z")

</div>

@matttunney -

```auto
{% if request.domain == 'preview.hs-sites.com' %}
 //the content editor is previewing the post 
{% else %}
 //the content editor is editing the post
{% endif %}

```

* * *

If this answer helped, please, mark as solved 😄

* * *

[tim@belch.io](mailto:tim@belch.io) | [forms.belch.io](https://forms.belch.io) | Design your own Beautiful HubSpot Forms; No coding necessary.

Drop by and say Hi to me [on slack](http://slack.belch.io/).
