Install guide: WordPress, no plugin
Add GetFoxChat to WordPress without a plugin
You can load GetFoxChat on a WordPress site without installing a plugin by queuing the script from a child theme's functions.php. This takes a little code, so if you would rather not edit theme files, the plugin way on the main WordPress guide is simpler.
Use a child theme, not the theme itself
How do you add GetFoxChat to WordPress without a plugin, step by step?
The code to paste into your child theme's functions.php:
add_action( 'wp_enqueue_scripts', 'getfoxchat_enqueue' );
function getfoxchat_enqueue() {
wp_enqueue_script( 'getfoxchat', 'https://getfoxchat.com/widget.js', array(), null, true );
}
add_filter( 'script_loader_tag', 'getfoxchat_tag', 10, 3 );
function getfoxchat_tag( $tag, $handle, $src ) {
if ( 'getfoxchat' !== $handle ) { return $tag; }
return '<script src="' . esc_url( $src ) . '" data-site-id="YOUR_SITE_ID" defer></script>';
}
- In GetFoxChat, open the install step for your site and copy your site ID. No account yet? Create one free.
- Create and activate a child theme, or open the functions.php of the one you already use. source
- Paste the code below into functions.php and replace
YOUR_SITE_IDwith your own site ID. - Queue the script from the
wp_enqueue_scriptshook. That is the hook WordPress documents for loading a script on the front end of the site. source - The last argument,
true, prints the script in the footer. source - The
script_loader_tagfilter lets the code add your site ID to the script tag WordPress prints. source - Save the file, then press Check my site in GetFoxChat. The chat switches on once GetFoxChat finds the snippet on your live pages.
How do you remove it later?
Delete the code you pasted from the child theme's functions.php and save the file.
Find out what your visitors can't find
See the 5 questions your visitors are likely to ask that your pages don't clearly answer. Free, no account needed.
Your AI Operator starts as Foxy. Rename it and give it your own avatar in Settings. Plans and what each includes: pricing.