Title: PHP Fatal error: Cannot redeclare addScriptAttributes()
Last modified: December 4, 2018

---

# PHP Fatal error: Cannot redeclare addScriptAttributes()

 *  Resolved [rindphi](https://wordpress.org/support/users/rindphi/)
 * (@rindphi)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-cannot-redeclare-addscriptattributes/)
 * Recently, I started to experience an error which shows up whenever I open a non-
   Gutenberg (Classic Editor) page in our website. The effect was that everything
   after the heading was left blank (so, the basic scaffold of the side appears,
   but the content is not rendered). Apache shows the following error:
 * `PHP Fatal error: Cannot redeclare addScriptAttributes() (previously declared
   in [path-to-wp]/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-
   main.php on line 309`
 * I could solve the issue myself by editing advanced-gutenberg-main.php and wrapping
   the definition of addScriptAttributes() like this:
 *     ```
       if (!function_exists('addScriptAttributes')) {
           function addScriptAttributes(...) {
               ...
           }
       }
       ```
   
 * I don’t know why that’s suddenly a problem (it used to work before, no new plugins
   were installed, but some have been updated), but the above hack solves the problem
   for non-Gutenberg pages, and Gutenberg pages (also those with Advanced-Gutenberg
   blocks) also work.
 * Maybe you want to integrate the quick-fix or look for the real error cause.
 * Thanks and Best Regards!
    -  This topic was modified 7 years, 6 months ago by [rindphi](https://wordpress.org/support/users/rindphi/).

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

 *  [JoomUnited](https://wordpress.org/support/users/joomunited/)
 * (@joomunited)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-cannot-redeclare-addscriptattributes/#post-10944602)
 * Hi,
 * Thanks for reporting!
    Seems that another plugin is declaring this function before
   us.
 * We’ll provide a fix in the next release.
 * Best regards
 *  [JoomUnited](https://wordpress.org/support/users/joomunited/)
 * (@joomunited)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-cannot-redeclare-addscriptattributes/#post-10958676)
 * Hi,
 * The latest Advanced Gutenberg should have fixed this issue along with the WordPress
   5 compatibility.
    Let me know.
 * Cheers,
 *  Thread Starter [rindphi](https://wordpress.org/support/users/rindphi/)
 * (@rindphi)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-cannot-redeclare-addscriptattributes/#post-10967471)
 * Hi,
 * seems to work now! Thanks!
 * Have a nice day.
 *  [JoomUnited](https://wordpress.org/support/users/joomunited/)
 * (@joomunited)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-cannot-redeclare-addscriptattributes/#post-10967539)
 * Hi,
 * I’m glad your issue is addressed!
 * If you like the plugin it would be cool to drop us a review, it really helps 
   us especially our support team here. Direct review link:
    [https://wordpress.org/support/plugin/advanced-gutenberg/reviews/?filter=5](https://wordpress.org/support/plugin/advanced-gutenberg/reviews/?filter=5)
 * Thanks a lot!
 * Cheers,

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

The topic ‘PHP Fatal error: Cannot redeclare addScriptAttributes()’ is closed to
new replies.

 * ![](https://ps.w.org/advanced-gutenberg/assets/icon-256x256.png?rev=3393761)
 * [PublishPress Blocks - Block Controls, Block Visibility, Block Permissions](https://wordpress.org/plugins/advanced-gutenberg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-gutenberg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-gutenberg/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-gutenberg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-gutenberg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-gutenberg/reviews/)

## Tags

 * [PHP Fatal error](https://wordpress.org/support/topic-tag/php-fatal-error/)
 * [white page](https://wordpress.org/support/topic-tag/white-page/)

 * 4 replies
 * 2 participants
 * Last reply from: [JoomUnited](https://wordpress.org/support/users/joomunited/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-cannot-redeclare-addscriptattributes/#post-10967539)
 * Status: resolved