Title: Fatal error: using_index_permalinks
Last modified: July 19, 2018

---

# Fatal error: using_index_permalinks

 *  [R3dRidl3](https://wordpress.org/support/users/r3dridl3/)
 * (@r3dridl3)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/)
 * Hello,
 * When I activate the plugin and run a script with:
 * header(‘Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
   check=0’);
    $dir = dirname(__FILE__); define(‘WP_USE_THEMES’, false); $root =”;
   $dir = str_replace(‘\\’,’/’,$dir); $dir = explode(‘/’,$dir); $count = 0; foreach(
   $dir as $piece) { $count++; if($count < count($dir)-2) { $root .= ‘/’.$piece;}}
   $root = substr($root,1).’/wp-load.php’; require($root);
 * I get the following error:
 * Fatal error: Call to a member function using_index_permalinks() on null in /www/
   ftpstorage2/webton402/webton402/wp-includes/rest-api.php on line 313
 * Could you please fix this?
 * WP version: 4.9.7

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

 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-10567415)
 * Hi [@r3dridl3](https://wordpress.org/support/users/r3dridl3/),
 * This is not related to my plugin. Please check your code again.
 *  Thread Starter [R3dRidl3](https://wordpress.org/support/users/r3dridl3/)
 * (@r3dridl3)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-10575134)
 * Well, how do you explain that it works flawless without your plugin? How can 
   you just say that it’s not related without taking a look at it?
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-10581246)
 * Hi [@r3dridl3](https://wordpress.org/support/users/r3dridl3/),
 * My plugin is responsible for searching. With other plugins, does your code work?
   I added your code to your functions.php file and I have no error using my plugin.
 * Sometimes it happens that the written code has a bad effect on the plugins, but
   that does not mean that they are bad. The more so because my plugin is used since
   people and no one reported problems.
 * Please write to me what your code should do and I will try to help you.
    -  This reply was modified 7 years, 10 months ago by [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/).
 *  Thread Starter [R3dRidl3](https://wordpress.org/support/users/r3dridl3/)
 * (@r3dridl3)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-10582941)
 * The piece you see only loads WP without theme. After that there was some code
   for a cronjob via a .php file.
 * It’s not there in the issue because i tried to remove as much as possible and
   even with the bare minimum it still gives an error.
 * Please try it yourself.
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-10583825)
 * In what file do you add this code? Please send me instructions on how to run 
   it.
 *  Thread Starter [R3dRidl3](https://wordpress.org/support/users/r3dridl3/)
 * (@r3dridl3)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-10585746)
 * You can add this code in the theme that is active. In it’s own file. Nothing 
   more nothing less. Than go to the exact path in your browser to run the file.
   Remember it’s a cronjob file.
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-10627096)
 * Please give me screenshots for each steps.
 *  [andrewtmiller91](https://wordpress.org/support/users/andrewtmiller91/)
 * (@andrewtmiller91)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-11045026)
 * I also get this error whenever trying to use the WP CLI while this plugin is 
   activated on my site.
 * I also get this notice:
    Notice: Use of undefined constant AUTOSAVE_INTERVAL –
   assumed ‘AUTOSAVE_INTERVAL’ in /Users/andrewmiller/Sites/bcen/wp-includes/script-
   loader.php on line 1086
 * The fatal error only occurs while the plugin is active on the site.
 * I am thinking that maybe it has something to do with when the plugin is initialized?

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

The topic ‘Fatal error: using_index_permalinks’ is closed to new replies.

 * ![](https://ps.w.org/acf-better-search/assets/icon-256x256.png?rev=2636287)
 * [ACF: Better Search](https://wordpress.org/plugins/acf-better-search/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-better-search/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-better-search/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-better-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-better-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-better-search/reviews/)

## Tags

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

 * 8 replies
 * 3 participants
 * Last reply from: [andrewtmiller91](https://wordpress.org/support/users/andrewtmiller91/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-using_index_permalinks/#post-11045026)
 * Status: not resolved