Articles on: Developers

Change URLs in the preload list

FlyingPress automatically preloads a list of URLs, including:
- Home page
- Posts
- Pages
- Custom posts
- Authors
- Catgories, tags and other traxonomies

Using flying_press_preload_urls filter, you can customize the list of URLs to preload.

Add URLs to preload



add_filter('flying_press_preload_urls', function ($urls) {
  $urls[] = 'https://example.com/your-page/';
  $urls[] = 'https://example.com/another-page/';
  return $urls;
});


Remove URLs from preload



add_filter('flying_press_preload_urls', function ($urls) {
  unset($urls['https://example.com/your-unwatend-page/');
  unset($urls['https://example.com/another-unwatend-page/');
  return $urls;
});


Limit number of URLs



Limits the numbers of URLs to preload to 200:

add_filter('flying_press_preload_urls', function ($urls) {
  return array_slice($urls, 0, 200);
});

Updated on: 18/12/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!