Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8951571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:41:41+00:00 2026-06-15T13:41:41+00:00

Is there an API that will allow my to copy or duplicate and item

  • 0

Is there an API that will allow my to copy or duplicate and item just getting a single version?
Item.Duplicate() and Item.CopyTo() both get all numbered versions and languages.

I’m on Sitecore 6.3.1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:41:42+00:00Added an answer on June 15, 2026 at 1:41 pm

    item.Versions.RemoveAll(true); also removes the most recent version.

    You could copy or duplicate the item (with all its versions) and then try something like this:

       private void RemovePreviousVersions(Item myItem, bool includeAllLanguages)
        {
            // get the most recent version
            Item currentVersion = myItem.Versions.GetLatestVersion();
            Item[] versions = myItem.Versions.GetVersions(includeAllLanguages);
    
            // loop through the item versions
            foreach(Item itemVersion in versions)
            {
                // remove the version if it is not the most recent
                if (!itemVersion.Version.Number.Equals(currentVersion.Version.Number))
                {
                    itemVersion.Versions.RemoveVersion();
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any api/lib for python that will get me the synonyms of a
Is there any service or api that will allow me to accept credit card
is there a ruby curl library that will allow me to duplicate this request:
Is there some component/api/method available that will allow me to export a CURRENT PAGE
I was wondering if there is an API that will allow me to insert
Is there a google api that will calculate closest pair of points? Where I
Is there a web-service/API that will provide information on who the US State and
Is there an API call for Crystal Reports 8.5 that will generate a TTX
Is there a Windows API call or Delphi call that will tell me what
Is there an API that works for pre OS 3.2 for getting the current

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.