Skip to main content
Participating Frequently
February 19, 2023
Answered

delete history log in metadata

  • February 19, 2023
  • 2 replies
  • 6704 views

By mistake, I had my preferences set to record a history log in metadata.  I want to share the photo but without the recipient being able to see the changes I've made.  Is there a way to delete or clear the history log?  Or to send the photo without that information?  (It needs to be a good version of the image, so something like a screenshot won't work.)   (I'm using PS CS6 in windows).  Any help would be appreciated.  

This topic has been closed for replies.
Correct answer Stephen Marsh

If you don't have any other requirements for retaining metadata, you can use Export As or Export Save for Web (Legacy) which both strip metadata or offer options for retaining limited metadata for JPEG and PNG.

 

Another option is to select all layers, then use the Layer menu > Duplicate command to dupe the layers to a new file, which will not include document metadata, which is more useful if you need to share say a layered PSD.

 

Other options would be a custom script for Photoshop, Bridge or using 3rd party software such as ExifTool.

 

A generic XMP metadata removal option is part of the following script (not specifically history):

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/free-script-remove-selected/m-p/10104624#U11724396

 

2 replies

Stephen Marsh
Community Expert
Community Expert
February 20, 2023

Here is an example of a Script that would remove Photoshop History Log metadata from an open document:

 

// Remove Photoshop History Log Metadata from Open Doc.jsx

#target photoshop

removeHistoryLogMeta();

function removeHistoryLogMeta() {
    if (!documents.length) return;
    if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
    var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);
    XMPUtils.removeProperties(xmp,XMPConst.NS_PHOTOSHOP, "History", XMPConst.REMOVE_ALL_PROPERTIES);
    app.activeDocument.xmpMetadata.rawData = xmp.serialize();
} 

 

 

Depending on workflow requirements, a script that processed a folder of files, or a version for Adobe Bridge script may be preferred.

 

EDIT: Here is one for a folder of supported file formats, you can add/remove file extensions as required from the code:

 

// Remove Photoshop History Log Metadata from Folder of Files.jsx

#target photoshop;  

var inputFolder= Folder.selectDialog ("Please select folder to process");  
if(inputFolder != null){  
var fileList  = inputFolder.getFiles(/\.(jpg|jpeg|tif|tiff|psd|png)$/i);  
for(var a in fileList){removeHistoryLogMeta(fileList[a]);}  
}  
function removeHistoryLogMeta(selectedFile) {          
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");       
var xmpFile = new XMPFile( selectedFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_UPDATE | XMPConst.OPEN_USE_SMART_HANDLER );   
var xmp = xmpFile.getXMP();  
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "History");  
if (xmpFile.canPutXMP(xmp)) {   
        xmpFile.putXMP(xmp);  
         xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);   
         }                
};    

 

EDIT 2:

Here is one for selected files in Adobe Bridge (look in the Tools menu once installed):

 

/*
Remove Photoshop History Log Metadata from Adobe Bridge.jsx
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/hide-camera-raw-settings-in-jpeg-metadata/m-p/10306319
*/

#target bridge

if (BridgeTalk.appName == "bridge") {
    removeHistoryLogMeta = new MenuElement("command", "Remove Photoshop History Log Metadata", "at the end of Tools");
}
removeHistoryLogMeta.onSelect = function () {
    if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
    var sels = app.document.selections;
    for (var a in sels) {
        var thumb = new Thumbnail(app.document.selections[a]);
        var md = thumb.synchronousMetadata;
        var xmp = new XMPMeta(md.serialize());
        if (thumb.hasMetadata) {
            XMPUtils.removeProperties(xmp, XMPConst.NS_PHOTOSHOP, "History", XMPConst.REMOVE_ALL_PROPERTIES);
            var updatedPacket = xmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
            thumb.metadata = new Metadata(updatedPacket);
        }
    }
};

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Participant
May 31, 2024

Hi! I tried to follow all of the steps from your blog for Bridge, but there is no script anywhere in Bridge. I don't know much and I 'm just trying to be able to remove all edit history from my files. Thanks for any help!

Stephen Marsh
Community Expert
Community Expert
May 31, 2024

@Luxseniors wrote:

Hi! I tried to follow all of the steps from your blog for Bridge, but there is no script anywhere in Bridge. I don't know much and I 'm just trying to be able to remove all edit history from my files. Thanks for any help!


 

In this example, the script named "Clear History from Metadata.jsx" was saved as a plain-text file (not rich-text) in the Startup Scripts folder:

 

 

After restarting Bridge, you should receive a message that a new script has been installed and do you wish to enable the script. I'm not seeing this in Bridge 2024, however, going into preferences I can see that the script is installed and active:

 

 

Then select the images and go to the Tools menu:

 

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
February 19, 2023

If you don't have any other requirements for retaining metadata, you can use Export As or Export Save for Web (Legacy) which both strip metadata or offer options for retaining limited metadata for JPEG and PNG.

 

Another option is to select all layers, then use the Layer menu > Duplicate command to dupe the layers to a new file, which will not include document metadata, which is more useful if you need to share say a layered PSD.

 

Other options would be a custom script for Photoshop, Bridge or using 3rd party software such as ExifTool.

 

A generic XMP metadata removal option is part of the following script (not specifically history):

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/free-script-remove-selected/m-p/10104624#U11724396

 

laris99Author
Participating Frequently
February 20, 2023

Thanks very much for all the suggestions.  Using the layers menu trick worked and deleted all the metadata.  I've also downloaded the exiftool and tried that and it looks like that will delete the history log and leave some camera info so that should be helpful.  I tried to use Export As but for some reason the only options that show there are Paths to Illustrator and Zoomify -- I'm not sure what those are but when I tested them they unfortunately  didn't seem to be usable.  Thanks again for the help.

Stephen Marsh
Community Expert
Community Expert
February 20, 2023
quote

I've also downloaded the exiftool and tried that and it looks like that will delete the history log and leave some camera info so that should be helpful.


By @laris99

 

The three scripts that I posted will do similar to ExifTool, only removing the History Log metadata.

 

For the sake of completeness, the ExifTool command would be similar to:

 

exiftool -XMP-photoshop:History= "C:\Path to\File.jpg"