Title: Console errors on backend &#8211; breaking other plugins
Last modified: June 11, 2023

---

# Console errors on backend – breaking other plugins

 *  Resolved [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * (@harmr)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/console-errors-on-backend-breaking-other-plugins/)
 * Hi,
 * I get the following errors on backend, when your plugin is active since one of
   the latest updates: “Uncaught TypeError: document.getElementById(…) is null  
   <anonymous> [https://www.mapsmarker.com/wp-admin/edit.php:128&#8221](https://www.mapsmarker.com/wp-admin/edit.php:128&#8221);
 * This results in breaking maps created with our plugin “Maps Marker Pro” (and 
   probably the functionality of other plugins too, as this error seems to occur
   on every backend page).
 * I kindly ask you to release a fix ASAP.
 * thx,
 * Robert

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * (@harmr)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/console-errors-on-backend-breaking-other-plugins/#post-16810243)
 * I did some further researched – the bug has been introduced with v4.1.8 with 
   sitemap.php additions in the ga_header-function or to be more precise with the
   following script(s):
 *     ```wp-block-code
       <script>setTimeout(()=>{	document.getElementById("discard_content").classList.add("discard_button_outside_settings")
       document.getElementById("discard_content").classList.remove("discard_button")
       },200);</script>
       ```
   
 * Your header code is added to each backend page and if the element with the ID
   discard_content is not available on that page, it breaks all other related js-
   depended code (like ours)!
 * I´d suggest to enqueue your code on your plugins pages only and additionally 
   check if the element exists before running the js functions above, like this 
   e.g.
 *     ```wp-block-code
       <script>
       setTimeout(()=>{
           let discardContent = document.getElementById("discard_content");
   
           if (discardContent) {
               discardContent.classList.add("discard_button_outside_settings");
               discardContent.classList.remove("discard_button");
           }
       }, 200);
       </script>
       ```
   
 * thx,
 * Robert
 *  [saurabhdhariwal01](https://wordpress.org/support/users/saurabhdhariwal01/)
 * (@saurabhdhariwal01)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/console-errors-on-backend-breaking-other-plugins/#post-16811842)
 * [@harmr](https://wordpress.org/support/users/harmr/) Thankyou for contacting 
   us,
   We will track this and make the changes in future release.
 *  Thread Starter [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * (@harmr)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/console-errors-on-backend-breaking-other-plugins/#post-16949793)
 * thanks – seems to have been fixed

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Console errors on backend – breaking other plugins’ is closed to new 
replies.

 * ![](https://ps.w.org/google-sitemap-generator/assets/icon-256x256.png?rev=2713572)
 * [XML Sitemap Generator for Google](https://wordpress.org/plugins/google-sitemap-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-sitemap-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-sitemap-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-sitemap-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-sitemap-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-sitemap-generator/reviews/)

## Tags

 * [incompatibility](https://wordpress.org/support/topic-tag/incompatibility/)

 * 3 replies
 * 2 participants
 * Last reply from: [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/console-errors-on-backend-breaking-other-plugins/#post-16949793)
 * Status: resolved