[SalesForce] Convert Rich text area field to long text area

I have a rich text area custom field on custom object and I am trying to convert it to long text area fields but when i exported the data using data loader,I see lot of html tags.Is it possible to restore exact formating in long text area field

Best Answer

If you just change the Field Type from Rich Text to Long Text, Salesforce will take care of stripping out HTML tags while converting line breaks into new lines.

Just go to Setup and find your field, then click "Change Field Type".

When you select "Text Area (Long)", Salesforce will present a "Field Conversion" screen which asks you what you want to do with the HTML markup:

Field Conversion screen

Select "Remove the HTML Markup. Only the content will be kept" , and click OK. Click Save.

I have tested this conversion, and it worked exactly as expected --- line breaks were converted into newlines, while all other HTML tags were stripped out and ignored. I had a Rich Text field, and for one of my records, the value looked like this:

Original Rich Text

And after converting the field to a Long Textarea, the value of the field for this record looks like this:

Long Text after conversion