# Is there a way to make a c++ header & code file editor only?

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-make-a-c-header-code-file-editor-only/2683019>\
**Category:** Programming & Scripting\
**Tags:** Editor-Scripting, unreal-engine, Packaging, editor, CPP, question\
**Created:** [December 8, 2025, 4:59am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-c-header-code-file-editor-only/2683019 "2025-12-08T04:59:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kotaru\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kotaru\_1](https://forums.unrealengine.com/u/Kotaru_1)\
**Post date:** [December 8, 2025, 4:59am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-c-header-code-file-editor-only/2683019/1 "2025-12-08T04:59:58Z")

</div>

Was wondering if there was a way to make an entire c++ file editor only, rather than just encasing the entire script with WITH\_EDITOR preprocessor. Seems kind of dumb to make the compiler open up an (effectively) empty script. I feel like this sort of thing surely exists within the editor by default.

Also worth mentioning this is within a plugin. I’d like this script to be marked editor only by default in any projects this plugin is added to.

Any info is greatly appreciated

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [December 8, 2025, 7:24am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-c-header-code-file-editor-only/2683019/2 "2025-12-08T07:24:41Z")

</div>

> [@Kotaru\_1](#):
>
> editor only by default

You need to change [the module type](https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-modules) in your .uplugin for this (Unkooked Only or Editor).  
This code does not get into the packaged project.

---

<div class="post-metadata">

**Author:** ![Kotaru\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kotaru\_1](https://forums.unrealengine.com/u/Kotaru_1)\
**Post date:** [December 8, 2025, 7:46am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-c-header-code-file-editor-only/2683019/3 "2025-12-08T07:46:46Z")

</div>

But what if I only want only a specific script in the plugin to not be packaged? Or would the editor only bits need to be moved to another plugin to achieve this?

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [December 8, 2025, 8:08am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-c-header-code-file-editor-only/2683019/4 "2025-12-08T08:08:03Z")

</div>

A plugin can have any number of modules (one with the same name is simply created by default).  
Code for the editor and runtime should be in separate modules. You can connect (include) the runtime module to the editor module (but not vice versa).

---

<div class="post-metadata">

**Author:** ![Kotaru\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kotaru\_1](https://forums.unrealengine.com/u/Kotaru_1)\
**Post date:** [December 8, 2025, 8:10am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-c-header-code-file-editor-only/2683019/5 "2025-12-08T08:10:35Z")

</div>

OH okay awesome, I was under the impression the plugin was just a type of module, and couldn’t contain inner modules
