Try our conversational search powered by Generative AI!

Copied page automatically published


I noticed that, if you copy a published page, the copy is automatically published as well.
In my opinion, this is unwanted behaviour since it creates duplicate content on your website.

I want to create an InitializableModule to fix this, but I'm wondering how I can detect that a page is new and is a copy of another page.

And should I just cancel the publish event or is there some kind of property that I can set that will prevent the page from being published in the first place?

Edited, Dec 15, 2016 8:31

Thanks Russell, that would seem like the right thing to do then.

Is there some way I can track the issue? I don't have access to support since I'm not certified yet...

Dec 16, 2016 9:13

One option is to intercept the IDataImporter interface and replace SaveAction for copy operations, something like:

using EPiServer.Core;
using EPiServer.DataAccess;
using EPiServer.Enterprise;
using EPiServer.Framework;
using EPiServer.ServiceLocation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace EPiServerSite4
    public class NotPublishedCopyModule : IConfigurableModule
        public void ConfigureContainer(ServiceConfigurationContext context)
            context.Services.Intercept<IDataImporter>((s, d) => new NoPublishOnCopyDataImporter(d));

        public void Initialize(EPiServer.Framework.Initialization.InitializationEngine context){}
        public void Uninitialize(EPiServer.Framework.Initialization.InitializationEngine context){}

    public class NoPublishOnCopyDataImporter : IDataImporter
        private IDataImporter _defaultImporter;

        public NoPublishOnCopyDataImporter(IDataImporter defaultImporter)
            _defaultImporter = defaultImporter;

        public void Abort()

        public ITransferLog Import(Stream stream, ContentReference destinationRoot, ImportOptions options)
            if (options.TransferType == EPiServer.Core.Transfer.TypeOfTransfer.Copying)
                options.SaveAction = SaveAction.CheckOut | SaveAction.SkipValidation;

            return _defaultImporter.Import(stream, destinationRoot, options);

        public IImportStatus Status
            get { return _defaultImporter.Status; }
Dec 16, 2016 16:24

Thanks Johan, I will try that if this is not picked up as a bug by Episerver...

Dec 22, 2016 10:40

Thanks Russell, for your help.

I'm gonna talk to our product owner about this... see what we can do.

Jan 24, 2017 13:48

And what is decided by the product manager?

Sep 19, 2018 16:34

A simple way to copy a published page without publishing it is to use project. You create a Project,  make sure that it active and selected before you start pasting. From then, any content you copy&paste from 1 folder to another will be a new content without Published date.

Edited, Sep 25, 2018 9:07
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.