You can use Javascript (faster than jQuery because it uses native code):
http://jsfiddle.net/ks60L4h9/3/
var p = document.getElementsByTagName('p'); while(p.length) { var parent = p[ 0 ].parentNode; while( p[ 0 ].firstChild ) { parent.insertBefore( p[ 0 ].firstChild, p[ 0 ] ); } parent.removeChild( p[ 0 ] ); }
This selects all paragraphs, and then uses .contents () to target the content of <p> , and then .unwrap() to remove its parent element <p> .
source share