Title: Error: Non static method being called statically
Last modified: August 20, 2016

---

# Error: Non static method being called statically

 *  [djeyewater](https://wordpress.org/support/users/djeyewater/)
 * (@djeyewater)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/)
 * I am getting the following error on my site:
 * `Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback,
   non-static method GoogleSitemapGeneratorLoader::Enable() should not be called
   statically in /wp-includes/plugin.php on line 403`
 * Either `Enable` needs to be declared as a static method, or it should not be 
   called statically. (I am not sure which one is correct).
 * [http://wordpress.org/extend/plugins/google-sitemap-generator/](http://wordpress.org/extend/plugins/google-sitemap-generator/)

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

 *  Thread Starter [djeyewater](https://wordpress.org/support/users/djeyewater/)
 * (@djeyewater)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237640)
 * Getting these errors as well:
 *     ```
       Strict standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::KillFrontpageQuery() should not be called statically in /wp-includes/plugin.php on line 484
       Strict standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::KillFrontpagePosts() should not be called statically in /wp-includes/plugin.php on line 227
       ```
   
 * sitemap-loader.php line 125 and 129
 *  [goldpups](https://wordpress.org/support/users/goldpups/)
 * (@goldpups)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237676)
 * > Strict Standards: call_user_func_array() expects parameter 1 to be a valid 
   > callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not
   > be called statically in /wp-includes/plugin.php on line 403
 * try this:
    1. open file /wp-content/plugins/google-sitemap-generator/sitemap.
   php 2. find line: `function Enable() {` 3. replace this line with: `public static
   function Enable() {`
 *  [AltIvan](https://wordpress.org/support/users/altivan/)
 * (@altivan)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237677)
 * Thank you **goldpups**, that was enough to stop showing the warning in the homepage.
 * In case you are seeing similar errors in other parts just change all the other
   functions to start with _public static function_ instead of just _function_ inside
   sitemap.php
 *  [J.D. Grimes](https://wordpress.org/support/users/jdgrimes/)
 * (@jdgrimes)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237678)
 * Yes, I’ve had this as well:
 *     ```
       PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-includes/plugin.php on line 406
       [17-Aug-2013 13:44:07 UTC] PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::RegisterAdminPage() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-includes/plugin.php on line 406
       [17-Aug-2013 13:44:07 UTC] PHP Strict Standards:  Non-static method GoogleSitemapGeneratorLoader::GetBaseName() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-content/plugins/google-sitemap-generator/sitemap.php on line 114
       [17-Aug-2013 13:44:07 UTC] PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::CallHtmlShowHelpList() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-includes/plugin.php on line 173
       [17-Aug-2013 13:44:07 UTC] PHP Strict Standards:  Non-static method GoogleSitemapGeneratorLoader::GetBaseName() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-content/plugins/google-sitemap-generator/sitemap.php on line 199
       ```
   
 * I hope this will be fixed in the next release.
 *  [Lanceosaurus](https://wordpress.org/support/users/lanceosaurus/)
 * (@lanceosaurus)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237681)
 * Thanks goldpups!
 *  [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237682)
 * I’m getting the same errors.
 *  [conservativeread](https://wordpress.org/support/users/conservativeread/)
 * (@conservativeread)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237683)
 * I am still getting errors with php 5.4 I had to remove plugin until it is fixed/
   updated errors in php. 55 as well,fyi
 *  [leejosepho](https://wordpress.org/support/users/leejosepho/)
 * (@leejosepho)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237684)
 * > In case you are seeing similar errors in other parts just change all the other
   > functions to start with public static function instead of just function inside
   > sitemap.php
 * I have done that, and I have also changed all of these in sitemap-core.php:
    
   function GetName() -to- public static function GetName() function GetDescription()-
   to- public static function GetDescription()
 * However, changing these definitely breaks the plugin:
    Non-static method GoogleSitemapGenerator::
   Enable() should not be called statically /wp-content/plugins/google-sitemap-generator/
   sitemap.php(250) Non-static method GoogleSitemapGenerator::GetInstance() should
   not be called statically /wp-content/plugins/google-sitemap-generator/sitemap.
   php(141) Non-static method GoogleSitemapGeneratorStatus::Load() should not be
   called statically, assuming $this from incompatible context /wp-content/plugins/
   google-sitemap-generator/sitemap-ui.php(684)
 *  [conservativeread](https://wordpress.org/support/users/conservativeread/)
 * (@conservativeread)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237685)
 * using php 5.4 and plugin version 4.0b11 solved the problem for me for now until
   this is updated I will use that beta.
 *  [conservativeread](https://wordpress.org/support/users/conservativeread/)
 * (@conservativeread)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237686)
 * still no help from author so I am using BWP Google XML Sitemaps v1.2.2 it works
   as good or better no errors on php5.3 or 5.4 im getting more traffic too. so 
   until I hear better I wil use this [http://wordpress.org/plugins/bwp-google-xml-sitemaps/](http://wordpress.org/plugins/bwp-google-xml-sitemaps/)
 *  Thread Starter [djeyewater](https://wordpress.org/support/users/djeyewater/)
 * (@djeyewater)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237687)
 * The error messages are only strict standards messages, the plugin should still
   work fine. If you’re seeing the error messages on your live website, then the
   issue is with your PHP configuration.
 * Try adding `ini_set('display_errors', 0);` to your wp-config.php file. (Or better
   yet, turn off display_errors in your php.ini). It won’t fix the errors, but it
   will hide them.

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

The topic ‘Error: Non static method being called statically’ 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/)

 * 11 replies
 * 8 participants
 * Last reply from: [djeyewater](https://wordpress.org/support/users/djeyewater/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/error-non-static-method-being-called-statically/#post-3237687)
 * Status: not resolved