Load Wordpress functions in custom php file

If you want to write something from blank in your Wordpress site and want to use your own php file for some custom code - you can load wordpress functions to be available:

Load Wordpress functions in custom php file 2020-06-19

define('WP_USE_THEMES', false); require('wp-load.php');

Just to validate if Wordpress functions are working, you can print blog name.

Custom.php file example:

define('WP_USE_THEMES', false); require('wp-load.php');
bloginfo( 'name' );

This gonna work if your custom file is in root Wordpress directory. Otherwise you should add backslash in deeper directory location before 'wp-load.php'.  E.g. if your file is in "wp-content/uploads/custom.php", include should be:
define('WP_USE_THEMES', false); require('../../wp-load.php');