You can add custom hander to item:created
event and set the value of Never Publish
to true:
public void OnItemCreated(object sender, EventArgs args)
{
var createdArgs = Event.ExtractParameter(args, 0) as ItemCreatedEventArgs;
Assert.IsNotNull(createdArgs, "args");
if (createdArgs != null)
{
Assert.IsNotNull(createdArgs.Item, "item");
if (createdArgs.Item != null)
{
Item item = createdArgs.Item;
item.Editing.BeginEdit();
item.Publishing.NeverPublish = true;
item.Editing.EndEdit();
}
}
}
and register it via patch file:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<events>
<event name="item:created">
<handler type="My.Assembly.Namespace.ClassName, My.Assembly" method="OnItemCreated" />
</event>
</events>
</sitecore>
</configuration>