I have a website that I'd like to remove some content using jQuery.
I'd like to find anything in my content with this opening symbol [ and closing symbol ] and delete them both including the content in between them.
To be clear, this is actually a Shortcode format from WordPress. And some examples of them include
- [cudazi_column width='6' class='alpha' ]
- [cudazi_column_end]
- [cudazi_column width='6' class='omega' ]
- [cudazi_slider slide_delay="4000" slide_effect="slide" categories="home" ]
I want to be able to remove these from the content using jQuery
Can anyone point me in the right direction?
I have used this script in the past for another project and was wondering if I could use it again if I managed to get the right regex
$(".content").html(function(i,o){
return o.replace( /@[0-9:\s]+(am|pm)/ig, '' );
});