• Resolved tizz

    (@tizz)


    Hi, unfortunately I’m still here.
    Last night I realized with so much dismay that the plugin has removed all the “target = _blank” from all the links in the tag descriptions, or worse, in some cases it has completely removed the links and all the HTML formatting (italics, bolds, etc.) altogether. A disaster, given the large amount of links and formatting in each description, since them are rich in foreign terminology and the entire body of the tag descriptions acts as a kind of linked glossary: a complex job done by hand over years, tag by tag.

    I don’t think the plugin itself is the culprit, but the different functions / settings adopted to solve the issues described in this and this threads.
    As for the difference that some descriptions have lost all HTML formatting and others just the “target = _link” from the links, my thoughts is that perhaps it depends on when I assigned that tag to a group, since I did it at different times while I was testing various functions.
    The damage is for everything that was already present: if I make a new description now or fix one of those that have lost the HTML it seems that everything is maintained, but I have not yet worked enough or updated the site in other ways to know for sure, I have only done some test last night after the bitter discovery.

    Now, I imagine that unfortunately there is no cure to automatically recover all the formatting other than to arm myself with time and patience and redo everything by hand bit by bit, so what I ask is: do you think the situation is currently stable, i.e. the one I adopted in last thread (this), in the sense that I can begin the work sure that what I insert from now on will remain – also considerating what could happen when (if) you will replace the filter working on the core, and I will have to put “remove” in the “HTML in tag description” setting?

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • By default WordPress does not allow HTML in the tag description. When you save a tag and have HTML in the description, WordPress removes it. Some 3rd-party plugins, however, change this behavior to let you save HTML.

    The Tag Groups plugin lets you chose in the settings (“HTML in tag description”) if you want the default behavior (remove HTML) or let 3rd-party plugins keep it.

    That means that the plugin does not remove the HTML, it only lets WordPress do its default behavior or it lets 3rd party plugin change the default behavior.

    The custom code from the other threads changes only what appears on the page. The information in the database is not affected and you only need to modify that code.

    So, you could double-check in the settings that you have “keep” for “HTML in tag description”. Then you could save a tag description with HTML for testing. If that HTML is gone after saving the tag, I assume there is another plugin or piece of code that removes it. I hope that this helps you find out the cause of the problem.

    Thread Starter tizz

    (@tizz)

    OK, I see that it is the Yoast SEO plugin that modifies the default behavior, creating a visual view in the tag description editor and allowing the insertion of HTML. Switching from one view to the other nothing is lost, as it has never been lost in time or deactivating the plugin. It has never been a problem and still is, so much that I had forgotten that it was not the default behavior. I mean that it has always worked well and I would have continued to lose nothing – except for an unlikely plugin bug on that particular aspect, which is not happened. So, Yoast is definitely responsible for that “rich” editor, but I have no doubts that it is not the culprit about the sudden loss of those formatting.

    I know that it can be difficult to focus a case like mine, and that you probably won’t have others like mine because there are very few users who use the tag description field as I do, but maybe something has happened when I installed and activated your plugin as the remove / keep option was “remove” by default, or I saved it like this because it was the recommended one. Then, starting to assign some tags for testing, I changed that setting several times during the attempts to adjust the behaviors described in the reported topics. Only at the end it remained on “keep” as per your indication due to the coexistence with the function you kindly provided.

    Perhaps during one of the switches of that settings the HTML formatting was lost: on some descriptions by removing all the formatting altogether, on others only the “target_blank”, maybe depending on how the situation was when I assigned that particular tag.
    If you say that the various functions not stripped the HTML in the descriptions I believe you, but sure something else related to the plugin or its settings has did it, because that formatting was lost after the plugin activation and use even if I can’t say when or how, perhaps while proceeding with the tests and with the assignment of the tags at different times. In other words, it is sure that from a certain point on and even now I always had “keep”, but before there was also “remove” and something happened.

    I don’t have any other new plugin and no other new code, my plugin list has been the same for years until now and I have never lost the HTML formatting in those tag descriptions before.
    As already mentioned, the HTML formatting seems to remain if I do redo and save now, the loss has occurred before, maybe now it is stable, and here I return to the previous question.
    If, as you said in the other topic, you will change the code and I will remove that function and put “remove” in the settings as per your indication, do I might lose the formatting again? Because if I start putting them back in place as they were I wouldn’t want to lose my work again.
    I know it’s a difficult question to answer and you can’t be sure of that, but my fear is right here.

    I’m sorry to hear that the issue persists.

    I don’t see any way how the plugin could remove the HTML, other than using the “remove” option and then saving a tag with its description. The plugin doesn’t run through all tags, it just receives the parameters when you save one particular tag.

    Yes, the default setting is “remove”. That is for safety, and it must be the same as the default WordPress behavior. But this setting does not become active unless you save a tag, and even then it affects only that one tag.

    PS: I released now a new version that always keeps HTML in tag descriptions, if there is any. The HTML is sanitized – we allow only HTML tags that WordPress also allows in posts. This can be overridden.

    Still, this only works when saving a particular tag. It doesn’t affect all other tags.

    I hope that this is more user-friendly when someone wants to keep HTML and saves a tag while using the plugin’s default setting that remove the HTML.

    Thread Starter tizz

    (@tizz)

    Thank you Chris, so I just updated the plugin, and I don’t have to do anything else, right? (Other than redo what has been lost I mean…)
    I don’t have to insert that define and put “false”, right?

    I hope that you have backups of your database – if not, it is recommended to start creating them automatically.

    Please try to save one tag description with your HTML and check afterwards if all that HTML is still there. If something is missing, it means that the standard WordPress function (which was originally made for the HTML of posts, rather than tag descriptions) is too strict. Only in that case you need to define that constant.

    Thread Starter tizz

    (@tizz)

    The descriptions I edited yesterday still have all my HTML in place today. I forgot to ask if now I need to delete the function in functions.php.
    Thanks.

    If I remember correctly, your function also shortens the description in the tag clouds, so in that case it is still needed. If you are unsure, you could comment out the functions and check if the result looks still good.

    Thread Starter tizz

    (@tizz)

    Oh yes, you’re right. Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Lost all HTML formatting in tag descriptions’ is closed to new replies.