mass delete custom fields from object - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Anju ChackoAnju Chacko 

mass delete custom fields from object

How can we delete custom fields from object using IDE? I have many fields to be removed and cannot do it manually :(
Deepak AnandDeepak Anand
Hey Ann,

Have you tried Schema Builder ? Go to Setup | Schema Builder(Under the Build Section). Then do a Quick Find to get your Custom Object and check the same when you find it.

Now click on the Auto-Layout button so that the Object is placed on a Visible region of the Canvas. Now, right-click on the Fields and select 'Delete Field...'.

I hope this helps!

Johan YuJohan Yu
Have you try open object Source in IDE and delete the <fields> there ?
Anju ChackoAnju Chacko
Thanks Deepak. But this is again manual process only. also in schema builder i am not able to see api name.. so have to click on the field and see api name and then delete :(
Anju ChackoAnju Chacko
Hi Johan. I tried that. but not working
Jeff MayJeff May
Even if you have 200 custom fields to be deleted, that would take only a few minutes through the UI -- Click Delete from the field list.
Johan YuJohan Yu
Yeah, it may be not possible to delete using IDE. I used to update label, update picklist values and dependent fields massively using IDE and it worked.
Phil WaltonPhil Walton
Jeff is many custom fields do you need to delete???
Nica Anouk SiegertNica Anouk Siegert
Jeff May/Phil Walton - what do you mean by "through the UI/ field list" - I have about 50 plus fields to delete and even through the schema builder it is manual. Via the dev console I can highlight a bunch at a time but not delete them. 
Jeff MayJeff May
If you only have 50 fields to delete, that will take you about 5 minutes in the UI.  From the field list, click Delete, click "Yes I am sure" move on to the next one.  If you don't want to click the 'Are you sure', you can right click on Delete and open in new window.  The field will be deleted.
Nica Anouk SiegertNica Anouk Siegert
Thanks Jeff. Thats still manual, one by one field. There should be an option to select them all and click delete and confirm once. 
Nica Anouk SiegertNica Anouk Siegert
while the right click on delete/open in new window is a neat trick to bypass the confirm screen, I havent saved any clicks in general as I then end up having to close all newly opened windows/tabs 
Jeff MayJeff May
Except that if your config prevented a field from being safely deleted, you'd need to have a screen to list the problems, and then optionally allow the others to be deleted or not.

You can certainly log Ideas for things you'd like to change.  I thought your question was about how best to delete fields since you said you couldn't do it manually.  We've been pointing out that even with 200 fields, in the amount of time you've spent on this post, your fields could have been manually deleted safely and reliably.
Jeff MayJeff May
and how many clicks have you used typing this post about "not being able to do it manually"? I'd say, using click count, you are way behind.
Nica Anouk SiegertNica Anouk Siegert
The original question was never how do I delete fields, it was how do I mass delete fields (see title question). I don't find my attempting to learn a better, more effective approach as a waste of 'click' time. But thanks for the response anyhow. Too bad there is no direct solution to reliably mass delete numerous fields at once. Thats all I wanted to know really. 
Johan YuJohan Yu
I believe you are not looking to use Metadata API for this purpose
Nica Anouk SiegertNica Anouk Siegert
Thank you Johan- that was precisely what I was looking for. Much appreciated. I would mark this best answer but since it wasnt my question originally unfortunately I cannot.
Johan YuJohan Yu
Hi Nica, no problem.
happy to hear it.
Nick KeatesNick Keates
I too searched for the mass delete question but this answer was more than enough, as the process is very quick. Only had 25 to delete, but it didnt take long at all. 
I had no clue you could do these operations with schema builder, change attributes and names etc, massively useful so thanks to all contributors .. another little bit of knowledge gained!
Johan YuJohan Yu
Nick, I think there is no difference delete field from schema builder or from setup menu, can you share further?
Mohit BansalMohit Bansal

Using Schema builder, we have to manually delete each field. It is a time consuming process.

To fulfill Mass field deletion requirements, there is a Salesforce AppExchange App,

Salesforce BULK Object Field Creator - A Time Saver App....!!!

User-added image

Helps Admins & Developers to CREATE multiple fields, DELETE multiple Fields & Assign FLS for multiple profiles for multiple fields in single click
  • Drag Drop a csv or xls files which contains list of new fields to be created
  • Mullt-select your fields to be deleted and click Delete.

 - Bulk(multiple) Field Creation
 - Bulk(multiple) Field Deletion

 & lot more...

AppExchange Link:

For any further assistance, contact me:
Skype: mohit_bansal17
Mohit Bansal
Luke SpikerLuke Spiker
Jeff May has the best way to do through the UI, by right-clicking on the "Del" link and opening in new tab. Thank you Jeff.
Avanish KumarAvanish Kumar
I create an Idea for it. You can upvote that.
Lewis HowelLewis Howel
Hi all,

Just for info, I have to delete around 400 fields on a custom object in lightning. Via edit object, clicking arrow next to field and choosing delete and confirming, is around 5 secs in total. So for 450 fields, that's around 40 mins. Annoyingly, I will have to input manually a similar number of fields, so unless you have a good dev app, it's a good days worth of work with the re-adding. The deletion is not huge in teh grand scheme of things, and it will let you know if there's any dependant fields etc. to save any errors. I think it's just
Anastasia GklantzouniAnastasia Gklantzouni
@lewis Howel, is there a quick way to identify which fields are still being used. Trying to delete around 100 but not sure which ones. What has worked for you?
Lewis HowelLewis Howel
Hi @anastasia, for me, I knew they all needed deleting, so wasn't too hard. BUt perhaps try running the optimiser report from set up, that should show you the majority of fields not being utilised, either on page layouts, or at all.

Unfortuntaley, you will have to manually chose which ones to delete in one way or another though. So use the report, when you click on each field it will take you to it.

I have started using the Config Workbook, available for free on App Exchange, that does make it a lot easier to create/delete/modify etc. lots of fields.