Title: Automatically changes special characters
Last modified: March 1, 2023

---

# Automatically changes special characters

 *  Resolved [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * (@freedomsoftwareza)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/)
 * Good day
 * I have a code snippet that is suppose to count the amount of posts of a specific
   user. Where the code checks that the user is logged in it keeps changing one 
   of the special characters “>” to “&GT;”.
 * Here is the code:
 *     ```wp-block-code
       function total_post_count() {
       	$current_user = wp_get_current_user();
       	if ( 0 == $current_user->ID ) {
       	    return;
       	} else {
       		$profile_id = um_profile_id();
       		$count = count_user_posts( $profile_id );
       	    echo "<p class='post_count'>" . $count . "</p>";
       	}
       }
       add_shortcode( 'total_post_c', 'total_post_count' );
       ```
   
 * The “>” in line 3 is the one that keeps changing. The strange part is that the
   snippet works for a few days and then suddenly the snippet automatically deactivates
   due to a syntax error and I find that the “>” was changed to “&GT;”. When this
   happens all the other snippets also stop working although they are still activated.
   Once I change the “&GT;” back to “>” then I can activate this snippet and all
   the other snippets start working again.
 * Why would this keep happing at random intervals, sometimes after a few days, 
   and how do I go about preventing this change in the future?
    -  This topic was modified 3 years, 3 months ago by [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/).

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/automatically-changes-special-characters/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/automatically-changes-special-characters/page/2/?output_format=md)

 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16516966)
 * Hi [@freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/),
 * First thing to check is if you are running the latest version of the plugin, 
   we had an issue with special characters in a previous version that has been fixed.
 * Can you please enable error logging from the WPCode Settings to get more details
   about the error triggering the behaviour you described?
 *  Thread Starter [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * (@freedomsoftwareza)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16517513)
 * Hi [@gripgrip](https://wordpress.org/support/users/gripgrip/)
 * The plugin version is currently 2.0.8.1. We generally keep everything up to date
   on a weekly basis.
 * I have now turned on the error logging, but I will have to wait until the issue
   occurs again. I had to fix it again about 2 hours ago after I had to fix it about
   5 hours agon as well. Currently it is fine and working, but I will keep an eye
   on it until it happens again and then send you the report.
 *  Thread Starter [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * (@freedomsoftwareza)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16532021)
 * Hi [@gripgrip](https://wordpress.org/support/users/gripgrip/)
 * Ok, it finally changed again. I think it happened last week. I have send you 
   the error log using your contact form on your website. Hope that helps, or should
   I rather post it here?
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16532094)
 * Hi [@freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/),
 * Thank you for the update. Yes, that is better as posting the log here might reveal
   sensitive data on a public forum, I can’t find your message though, can you please
   try again using the form at [https://wpcode.com/contact](https://wpcode.com/contact)
 * Thank you
 *  Thread Starter [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * (@freedomsoftwareza)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16532157)
 * Hi [@gripgrip](https://wordpress.org/support/users/gripgrip/)
 * I have send you the information using the contact form on [https://wpcode.com/contact](https://wpcode.com/contact).
 * Thank you
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16532180)
 * Got the message, thank you, we’ll look into it and get back to you.
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16532762)
 * Thank you [@freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/),
   I have found the source of the issue.
 * This is actually a side-effect of our plugin automatically disabling some snippets
   due to an error and we are looking into improving this behaviour to avoid this
   issue in the future.
 *  Thread Starter [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * (@freedomsoftwareza)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16535096)
 * Thank you very much for the help and effort. I have made changes to the other
   snippet that could have potentially caused the error. Hopefully this will solve
   the issue. I will leave this topic open until the end of the week and if the 
   issue does not resurface then I will mark this topic as resolved.
 *  Thread Starter [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * (@freedomsoftwareza)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16538977)
 * Good day
 * Unfortunately the issue has not been resolved. The plugin changed the “>” character
   again even after making the changes as suggested. I changed the code snippet 
   with the mycred_get_users_cred function to mycred_get_users_balance which takes
   only one parameter. None of the snippets are being deactivated due to errors,
   all of them are still active, even the snippet with the “>” character that was
   changed. When this happens, all the other snippets stop working completely even
   though they are active. When I change the “&GT;” back to “>” then all the snippets
   suddenly works again, but as I said, none of the snippets throw any error and
   works perfectly fine when that character is not changed.
 * I can send you the error log again if that would help.
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16539057)
 * Thank you for the update [@freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)–
   yes, please send the updated log via email to take another look.
 * The snippet only gets changed if a snippet throws an error so the short-term 
   solution here is to make sure none of the snippets run into errors.
 *  Thread Starter [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * (@freedomsoftwareza)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16539192)
 * I have just send you the email with the error log txt attached and a small explanation
   with further details.
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16539315)
 * Hi [@freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/),
 * I sent you a reply with more details, but I think the issue is not in the snippet
   you are using but the function you are calling in your snippet is not supposed
   to be used for logged-out users and thus is throwing an error.
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16553111)
 * I am going to mark this as resolved for now, please let us know if the issue 
   comes up again.
 *  Thread Starter [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * (@freedomsoftwareza)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16560653)
 * Good day
 * I tested the code for a few days and made sure to have all the checks in place
   every time the issue reoccurs as you suggested, but yesterday it gave me the 
   exact same issue and the error log is virtually exactly the same. None of the
   solutions seems to work at this stage.
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/#post-16561219)
 * Hi [@freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/),
 * Thank you for the update and I’m sorry this is still an issue. While the character
   changing issue is related to the way WPCode handles automatic snippet deactivations
   in a very specific scenario like you have this is still a side-effect of the 
   snippet generating an error, otherwise it would not end up in that scenario.
 * If you don’t mind, I will reach out privately so that we can look at the snippet
   specifics to prevent this from happening in the future without exposing any specifics
   of your snippets in a public forum.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/automatically-changes-special-characters/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/automatically-changes-special-characters/page/2/?output_format=md)

The topic ‘Automatically changes special characters’ is closed to new replies.

 * ![](https://ps.w.org/insert-headers-and-footers/assets/icon-256x256.png?rev=2758516)
 * [WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager](https://wordpress.org/plugins/insert-headers-and-footers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-headers-and-footers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-headers-and-footers/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-headers-and-footers/reviews/)

## Tags

 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)
 * [textile](https://wordpress.org/support/topic-tag/textile/)

 * 17 replies
 * 2 participants
 * Last reply from: [freedomsoftwareza](https://wordpress.org/support/users/freedomsoftwareza/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/automatically-changes-special-characters/page/2/#post-16568456)
 * Status: resolved