Skip to main content
Participating Frequently
February 19, 2023
Answered

delete history log in metadata

  • February 19, 2023
  • 2 replies
  • 6710 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

laris99Author
Participating Frequently
February 20, 2023

Thanks very much for this.  Unfortunately I couldn't figure out how to install a script (still pretty much a newbie) but I'll keep this info if I figure it out!

Stephen Marsh
Community Expert
Community Expert
February 20, 2023
quote

Thanks very much for this.  Unfortunately I couldn't figure out how to install a script (still pretty much a newbie) but I'll keep this info if I figure it out!


By @laris99


I provided a link to my blog with full instructions. Please do try again when you have time.

 

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

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.

laris99Author
Participating Frequently
February 21, 2023
quote

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.


By @laris99

 

What version of Photoshop are you using?

 

You should see something like this:

 


I only have PS CS6.  This is what I see.