zubrag.com
Free php and cpanel scripts to automate your daily routine

Online Tools :: Strip HTML Tags

HTML Tags Stripper is designed to strip HTML tags from the text. It will also strip embedded JavaScript code, style information (style sheets), as well as code inside php/asp tags (<?php ?> <%php ?> <% %>). It will also replace sequence of new line characters (multiple) with only one. Allow tags feature is session sticky, i.e. it will remember allowed tags list, so you will have to type them only once.

You can either provide text in text area below, or enter URL of the web page. If URL provided then HTML Tags Stripper will visit web-page for its contents.

Known issues:
Tool is not yet working correctly with non-latin characters (cyrillic, etc.). Will be fixed soon.

Please enter HTML to strip tags from:

Or URL of the page:

Allow tags (will not remove them), example <p><br>




You might be interested in other online tools.

Comments

Snake
October 10, 2006
waw it's creat , how can I am download ?
Alex
January 17, 2007
Why don't you build one yourself snake. Just use PHP and use find / replace code.
Pat
January 20, 2007
no alex find replace will not work... we have to use strip_tag fucntion to remove all the html tag... the same is done in this tool... zubrag.com is doing a great work.
Alex
January 26, 2007
Of course you can do find / replace! There is no php function called strip_tag. The code probably loads the HTML formatted text and searches for <p> </p> and strips them, leaving the text between them. It would remove <img ...> tags including all the height & width which you would do with a search function: find instances of <img and remove this as far as the next instance of >.
Gaz
February 5, 2007
Alex, there is a php function caled strip_tags loot @ the manual!!
http://uk2.php.net/manual/en/function.strip-tags.php
Alex
February 12, 2007
Pat said - strip_atg - not strip_tags. Anyway - I shall do it my way, in my typical minimalist style of 3 lines of code
rollo
March 28, 2007
Good stuff. Any chance of modifying it to allow retention of "core" tags (eg <p>)?

Yes, we'll add unremovable tags feature this weekend
March 30, 2007
I'm working on a site and i want to print the current page title on the page not just in the title position how can i do that?
kl365
August 21, 2007
nice script but removes crlf from text files as well, not sure if its a bug or feature.
August 21, 2007
fantastic script.
August 28, 2007
is it available for download?
September 16, 2007
Very cool.

Works even on html+javascript+php. Love it :D:D:D:D
January 29, 2008
Very nice - it beats doing a ton of regex in Dreamweaver :-)

1 feature request: Can you have a check box that removes anything inside a p or br tag but leaves the tag it's self?

For example I want this:
<p class="a" style="padding:5px;">
Changed to this:
<p>
When I have selected that I want to retain the <p> tag and also checked this box.

Possible?

Thanks!
Matt M.
March 20, 2008
I have an excel document with 7000 fields that need to be stripped on html tags, any suggestions on how I can do this (find/replace is not an option-formulas to long) I can go field by field with this editor, but was hoping for something to knock it all out in one shot?
monzur0010 [anti-spam] yahoo.com
April 2, 2008
How can i get the Script??
briantw [anti-spam] briantw.com
April 4, 2008
Alex, you were proved wrong and you say, "anyway, I'll do it my way." Learn some humility and admit when you're wrong.
Pat
April 6, 2008
Thank you very much!
April 24, 2008
Double byte characters are corrupted.

Please try this.
http://honyaku.yahoofs.jp/url_result?ctw_=sT,eCR-JE,bF,hT,uaHR0cDovL3d3dzE1LmJpZy5vci5qcC9+dDk4OTA3L3N0cmlwdGFncy8=,qlang=ja|for=0|sp=-5|fs=100%|fb=0|fi=0|fc=FF0000|db=T|eid=CR-EJ,k5d1b27197cfee5060a070c53319d72d1,t20080425080604,
Paul
April 26, 2008
How can you get it to keep script tags?

Here is what I tried:
In the Allow Tags field, I typed the following:
<script><p><br><table><head><body><html>
<title><meta><br><link><tr><td><div>
<form><img><!DOCTYPE>

It removed the word !DOCTYPE and it removed all php and javascript code. Am I doing something wrong?
Paul
April 27, 2008
I want to remove all font tags. Unfortunately, this tool deletes script and comment tags. So first convert the script tags to an unusual string like <SSSS or SSSS>, and convert the comment tags to <HHHH and HHHH>. Then paste the text into the tool, and strip the unwanted (font) tags. Use the following keep tags string:
<SSSS><HHHH><a><input><p><br><table><head><body><html><title><meta><br><link><tr><td><div><form><img><!DOCTYPE>

After the font tags are stripped, re-convert the substituted strings back to their original state. The word !DOCTYPE will need to be re-typed.
Paul
April 27, 2008
The above post is what I came up with to answer my own question. Does anyone know a better way?

I want to remove only the font tags. Unfortunately, the tool removes script tags too - even if <script> is typed into the Allow Tags field.
April 30, 2008
It also removes carriage returns, making it not so useful for cleaning HTML tags from emails.
Ven
July 15, 2008
Alex can please post your minimalist code that does this? I'm always willing to try things more than one way and then choose the one that works best for the task at hand. Thanks!
visigraphic.com
August 3, 2008
can I download this script?
thanks


www.visigraphic.com
kill1 [anti-spam] killer.com
August 14, 2008
not a big deal
try this
http://in.php.net/strip_tags
smith
October 8, 2008
What program can I use to return the code to original file type after stripping and translation.....
protestant [anti-spam] programmer.net
November 20, 2008
I added the following text:
<strong><span style="font-size: 12px"><span style="text-decoration: underline"><span style="color: #cc0000"><span><span style="font-size: 12px">testing</span> </span></span></span></span></strong>
<1>Point no. 1
<2>Point no. 2
..
..
From the above text <1> and <2> should not have been removed, or should it. At least, I didn't want it. Those are only some points mentioned in the text.
PETRIX_23 [anti-spam] YAHOO.COM
January 14, 2009
I Want to learn more about vulnerable injection trick & tips for the beginner. thanks a lot.
Curda
January 31, 2009
Only use the function of php strip_tags();

print strip_tags($string,$tagsallowed);
fasfasdfasdf [anti-spam] dasdfasd.com
February 11, 2009
protestant programmer:

the way it works is by removing html style tags I assume. So html is anything inside <> and the <> even if it's not valid html if it's entered here inside <> it will be removed.
mohit
April 10, 2009
wow..its really cool..
how can i download this script?
i really need it...
April 30, 2009
Love the tag stripper! Would love to see one that retained the paragraph format of whatever gets pasted in... I'd pay a reasonable monthly fee to have access to that sucker!!!
ezcorp [anti-spam] codetel.net.do
May 16, 2009
Did not work for me!
My document still not accepted on the web application I am pasting the document because it still has HTML & Scripting tags after I pass it thru your stripper system.
beausaber23798 [anti-spam] yahoo.com
May 17, 2009
I agree the comments of April 30, although I would pefer to pay for a standalone version I could download. Thank you for spending the time & effort on this.
May 19, 2009
Thanks!!!!!!
May 20, 2009
Thanks a lot... Really useful for restoring pages made with FrontPage. There's like 500 <span> tags >_<
joshua.davies [anti-spam] live.com
August 11, 2009
DONT WORK HOW DDO ????????????????????
glennewing [anti-spam] hotmail.com
August 25, 2009
Hi.
This is exactly what I needed.
I have several large documents that need to be stripped. Any chance I can get the program, or send you the docs for stripping?
September 3, 2009
Thanks!!!
courcyceline [anti-spam] gmail.com
November 4, 2009
Hi,is there any way I could download the program, I have 2 huge files to process and the on-line tool does not allow this kind of volume. Happy to pay a reasonable fee! URGENT.
capsen
November 11, 2009
what if we allow some tag but we also want disallow javascript?
<p onclick="alert('hello')" > dfd</p>
Big Dave
November 13, 2009
Thanks for this - use it all the time.
bndady [anti-spam] gmail.com
February 21, 2010
Try adding a check so that content is only deleted between or after tags if the first letter(s) matches that of a valid HTML tag.

This will prevent accidental removal of non-HTML elements.
JDman
February 26, 2010
This is awesome, thanks
February 27, 2010
Thanks so much for doing this.
penworks [anti-spam] gmail.com
March 19, 2010
brilliant! Im cleaning up a whole load of weblearn content, and this is perfect for getting rid of tons of ugly unecessary code - tables, span styles, you name it its inthere! And now, by magic, it isnt! thx so much
April 8, 2010
Very cool
karyc [anti-spam] linearcorp.com
April 26, 2010
Can we get the PHP code for this HTML stripper? It is very useful. Thank you!
May 4, 2010
A good addition to this tool section you have would a script that would add or strip slashes automatically from php.
June 7, 2010
this should be the code:
echo strip_tags($your_html_text);

simply add a form and a $_POST condition to show
June 7, 2010
strip_tags will only strip html tags and will do nothing with css and javascript code, so strip_tags only solution will not work. Current tags stripper obviously does something more than just applying strip_tags function
July 28, 2010
Thanks a ton this has made my job as a summer student tons easier! Exactly what I needed.
August 2, 2010
Here is your solution ,

$str = your sring;
strip_tags(str_replace("&nbsp;","<br><br>",$str),'<br>');

make minor modification if required.
bbarrier [anti-spam] yahoo.com
February 23, 2011
I NEED this program. Please bring it back. It is the only program that works exactly for what I need--to cut out tags. Complex programs are useless.
March 18, 2011
Welcome back. You were MISSED!
March 18, 2011
YAW :)
test
April 13, 2011
test
markacartwright [anti-spam] gmail.com
May 8, 2011
I would like to use your tool, but it doesn't work for the Russian page I used it for. It spits out unicode numbers, not the characters I need!
Kerry
June 23, 2011
Oh my goodness, thanks for this. I am having the weirdest issue with hidden code in text taken from a pdf. Notepad won't remove it, and my html editor(s) won't show it. It's been making me crazy! This little gadget of yours has solved my problem and has been added to my bookmarks.
tomhermans [anti-spam] gmail.com
September 27, 2011
This is a fantastic tool, but because I need some kind of automation I re-built it for own use. One question though. After stripping tags, all content is nicely separated per line, how did you accomplish that. Standard the strip_tags function doesn't do that..
tomhermans [anti-spam] gmail.com
September 27, 2011
Found a solution:
$orig_content = strip_tags(html_entity_decode($orig_content)); // strip tags
$orig_content = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $orig_content); // remove empty lines
$orig_content = str_replace("\n", "<br />", $orig_content); // replace line ends by br tags
alena_diana18 [anti-spam] hotmail.com
October 7, 2011
ptmr esta pagina web apesta...
amsterdamoffice [anti-spam] yahoo.com
October 31, 2011
Hi there,
Yeh, great script! But I would like to keep the placement of pictures in the html text and remove everything else. Of course that would have to be done with a wildcard. Are wildcards possible?
Bill
November 16, 2011
I've used this for quite some time and it's a great product.
I have the following link
<A HREF="images/2011/2011_001a.jpg"> in the webpage. I would like to keep the images/2011/2011_001a.jpg part, and putting < <A HREF> to exclude doesn't work.
Any ideas?
November 17, 2011
Hey Bill, juast put "a" without quotes
Rishi
November 30, 2011
Hi All,; Is there any way i can add these tags to my text, for ex - if in my file "Cat" is in bold then it will appear as <b>Cat</b>...i need these tags to insert my data into database so that my application can read from there..Please help..
techxe.com
February 5, 2012
Really useful service. I have tried many other html stripping tools but this one is best. thanks
loving.beautydarling [anti-spam] gmail.com
March 1, 2012
can i download the above stripping Script
tim [anti-spam] getdim.com
March 22, 2012
its not working so well for me.
its only leaving me with a small portion of my text.
it seems to be eliminating the text inside the <font> tags as well as the tags themselves
March 29, 2012
Sweet!
April 3, 2012
I relate well to what someone else asked which is this:
1 feature request: Can you have a check box that removes anything inside a p or br tag but leaves the tag it's self?

For example I want this:
<p class="a" style="padding:5px;">
Changed to this:
<p>
When I have selected that I want to retain the <p> tag and also checked this box.

Possible?
guillermo [anti-spam] sanchezperez.net
July 21, 2012
hola . como se podria obtener este script
addison.engineer [anti-spam] gmail.com
August 1, 2012
strip tage is not working for [quote

example:

[quote='zeeshanbaig' pid='x123' dateline='1341498199']
How do you mean Jacj? Is it a twitter thing or a forum thing?

The forum side of it is that I need to change the twitter account feed shown here on detail page but I can't find where to edit it.
January 20, 2013
ooou thank you, this tool helped me a lot!!! I had a troubles with my webpage because there were so many <span> tags after I saved the documents and this helped me to get rid of them without spending hours! You should get the patent of this :-)) I added this webpage to my Favourities....
thanks again
Z
fcms1998 [anti-spam] hotmail.com
March 25, 2013
Saved meTONS of time.
Its a BREEZE
Thank You
Cass
Hardik Sondagar
May 9, 2013
HTML Tag Stripper with All Source Code and with new Design :
http://www.htmltagstripper.com
martin.corrick [anti-spam] gmail.com
June 5, 2013
Thanks for a very useful site - it has saved me many hours of work!
lisaedward.123 [anti-spam] gmail.com
June 18, 2013
This is a very useful information. Thanks for sharing.
<a href="http://www.fita.in/php-training-in-chennai/">PHP training in Chennai</a>
July 31, 2013
Wish it could also remove embedded style and script tag content. But it seems just a one liner around the PHP strip function
August 21, 2013
Thanks! Saved me hours.
Eduardo
September 12, 2013
Nice tool!

Thanks!
vcando [anti-spam] skoville.com
September 26, 2013
I wish I found this 150 movies ago!
Thank you.
juan valdez
October 14, 2013
it is in these mountains that juan valdez and his trusty goat gather coffee beans every morning
alvinchrist786 [anti-spam] gmail.com
October 19, 2013
Thanks for your outstanding memorial encounter and I also had such an experience.
<a href="http://www.finovera.com ">manage my bills online </a>
alf
December 23, 2013
This is a awesome tool. Just saved me allot of time and aggravation!! Thanks!
Greg
March 13, 2014
helped me filter a lot of porn
Benjamin
April 8, 2014
Awesome tool! Works better than 3 other tools I found!
yindri75 [anti-spam] ymail.com
April 29, 2014
thanks for this informations, up to date :)
June 23, 2014
hfxfhcc
j.gluesing [anti-spam] wayne.edu
June 30, 2014
I have confidential text that has html code embedded in it that I want to remove. I cannot post the text online to take advantage of the html tags stripper you provide. Is there a similar stripper for a Mac or PC that I can run on my desktop? I truly appreciate our help! Julia
jack [anti-spam] jackgarvey.com
July 25, 2014
Thank you, that saved me a log of tedious editing of HTML code. I'll be back :-)
Siva
August 25, 2014
Great work,..
Sergio Ronei Hentz
August 25, 2014
It's Great!!! =D
tricahyana [anti-spam] windowslive.com
September 4, 2014
great (y)
bambino
October 2, 2014
Thanks for producing this it has just saved me a lot of time! :)

One suggestion to improve it would be to automatically highlight the text in the output box.
<script>alert ("Teste de XSS Stored")</script>
October 6, 2014
<script>alert ("Teste de XSS Stored")</script>
indupandu.bavala [anti-spam] gmail.com
October 8, 2014
will i get the source code of the online Strip HTML Tags
October 14, 2014
it will be better if you increased the font size

Add Comment

E-mail or Name: Not required. Email will be protected from spammers

Comment: Please do not post unrelated comments

Anti-spam: Please enter (3fbf0a58) into the box