Skip to main content
tomoakin33355574
Participating Frequently
July 26, 2021
Answered

How can I delete multiple tags of both opening and closing tags but keep the text between tags?

  • July 26, 2021
  • 3 replies
  • 957 views

I want to delete multiple tags of both opening and closing tags.

For example, in the next tags,

 

<span class="b">text</span>

 

I want to delete both <span class="b"> and </span>

but text should not be deleted.

 

There are a lot of codes like 

 

<span class="b">text</span>

<span class="b">happy</span>

<span class="b">time</span>

 

How can I delete not only <span class="b">, but also </span> but keep the 

text

happy

time

? (in the example above)

 

Thank you for your help.

 

 

 

    This topic has been closed for replies.
    Correct answer B i r n o u

    @tomoakin33355574  try using search in files (Ctrl Shift F) then in advanced mode

     

    search for SPAN node

    havin an attribut class equal to B

     

    then in action of replacement choose

    cleaning node

     

    it will remove the node, but not the node text

    (be sure to make a back up of your site, before dealing with large search and replace in files

    3 replies

    B i r n o u
    B i r n o uCorrect answer
    Legend
    July 26, 2021

    @tomoakin33355574  try using search in files (Ctrl Shift F) then in advanced mode

     

    search for SPAN node

    havin an attribut class equal to B

     

    then in action of replacement choose

    cleaning node

     

    it will remove the node, but not the node text

    (be sure to make a back up of your site, before dealing with large search and replace in files

    Participant
    May 3, 2024

    This is the absolute best solution and should be identified as such

    tomoakin33355574
    Participating Frequently
    July 26, 2021

    I mean at the same time. like using find and replace all. not manually. I use dreamweaver. I really appreciate your help. 

    Legend
    July 26, 2021

    Well just perform 'Find and Replace' 3 times 1 for each situation, DW will take care of all the instances it finds.

     

    Find:

    <span class="b">happy</span>

    Replace with:

    happy

     

    Find:

    <span class="b">time</span>

    Replace with:

    time

     

     

    There may be an expression you can use to just find all instances of:

     

    <span class="b"></span>

     

    and replace it with nothing, lets see if anyone can help out with an expression.

    tomoakin33355574
    Participating Frequently
    July 26, 2021

     

    There may be an expression you can use to just find all instances of:

     

    <span class="b"></span>

     

    and replace it with nothing, lets see if anyone can help out with an expression.

     

    yes, exactly!  this is what I wanted to find out. I thought the same thing with you and thought it should not be difficult. But so far, adobe support even does not know it, so this can be very challenging topic. 

     

    I just wanted to get rid of all the unnecessary tags which is accidentally added.

     

    If we know this method, I think it helps a lot of blogers time, including me.

    Legend
    July 26, 2021

    You could use the Find and Replace option in Dreamweaver:

     

    Find:

    <span class="b">text</span>

     

    Replace with:

    text

    tomoakin33355574
    Participating Frequently
    July 26, 2021

    Thank you. 

     

    But I want to delete all the 

     

    <span class="b"></span>

     

    at the same time because 100 of the texts which uses 

     

    <span class="b"></span>