How to Publish an HTML Page from Claude or ChatGPT on WordPress via SFTP

Move an HTML page into WordPress over SFTP with a shortcode and a blank page template, either as a plugin or inside a child theme.

7 min read
לקריאה בעברית

You built a landing page in Claude, ChatGPT, or another AI tool and have an index.html file. A small plugin lets you publish it at an ordinary URL, such as https://example.com/ai-landing/. The WordPress editor holds the shortcode [eight_scope_ai_html]. The plugin reads the HTML from the server and displays it inside a template without the theme's menu or footer.

This guide uses FileZilla Client to transfer files, Visual Studio Code to edit them, and a browser to access WordPress admin. Download FileZilla Client · Download Visual Studio Code

1. Connect to the site over SFTP

  1. Have your WordPress administrator login and the hosting provider's SFTP details ready. You need the host, username, port, and either a password or an SSH key. Start on a staging site if you have one.
  2. In FileZilla, choose File → Site Manager → New Site, select SFTP – SSH File Transfer Protocol, and enter the hosting details. Port 22 is common. Some hosts specify a different port. On the first connection, compare the host key fingerprint to the one your provider supplied. FileZilla connection instructions
  3. On the server side, find the WordPress installation. It normally contains wp-admin, wp-includes, and wp-content. It may be in public_html, www, or a subdirectory. If the account hosts several sites, confirm which directory belongs to your domain.
FileZilla · Site Manager
Select Entry
My Sites
Example WordPress
New Site
General
Protocol
SFTP – SSH File Transfer Protocol
Host
sftp.example.com
Port
22
Logon Type
Ask for password
User
site-user
Connect
Select SFTP and enter the connection details from your hosting provider.

2. Find or create a child theme

Skip to the next step if you plan to use a standalone plugin. To use a child theme, open Tools → Site Health → Info → Active Theme in WordPress admin. Check for Parent theme and the theme directory. If a parent theme is listed, your active theme is a child. In SFTP, find its folder under wp-content/themes/. The Template field at the top of its style.css names the parent theme's directory. Site Health screen

WordPress · Site Health
ToolsSite Health
StatusInfo
Active Theme
Name
My Site Child
Parent theme
Twenty Twenty-Five (twentytwentyfive)
Theme directory location
/home/site/public_html/wp-content/themes/my-site-child
Open Active Theme. If the Parent theme field names a theme, the active theme is a child theme.

To create a child theme, make a local folder named my-site-child and save the following as style.css. Substitute the exact name of your parent theme folder on the server for twentytwentyfive.

/*
Theme Name: My Site Child
Template: twentytwentyfive
*/

Upload the folder to wp-content/themes/my-site-child/ and activate My Site Child under Appearance → Themes. On an existing site, verify its menus and layout on staging after activation. Loading the parent and child styles depends on the parent theme. Working in the child theme keeps your changes through parent theme updates. WordPress child theme guide

FileZilla & WordPress · Child Theme
FileZilla · Remote site
/public_html/wp-content/themes/
my-site-child
style.css
AppearanceThemes
My Site Child
Activate
Upload the child theme folder with style.css, then activate it under Appearance → Themes.

3. Build the plugin locally

Create a folder named eight-scope-ai-html, open it in VS Code through File → Open Folder, and use New File in Explorer to create these four files. Save them as UTF-8 without a byte-order mark and check each extension. VS Code Explorer

Visual Studio Code · Explorer
ExplorerNew File
eight-scope-ai-html
eight-scope-ai-html.php
blank-template.php
landing-content.html
landing.css
landing-content.html
<main id="eight-scope-ai-landing" lang="en" dir="ltr">
    <h1>My landing page</h1>
</main>
Keep the four files in one folder. The landing-content.html file contains the page body.
eight-scope-ai-html/
  eight-scope-ai-html.php
  blank-template.php
  landing-content.html
  landing.css
Open the four example files

eight-scope-ai-html.php

This file registers the shortcode. On the ai-landing page that contains it, the plugin selects the blank template and loads its stylesheet and optional script.

<?php
/**
 * Plugin Name: 8SCOPE AI HTML Page
 * Description: Renders a local HTML fragment on a blank WordPress page.
 * Version: 1.0.0
 */

defined( 'ABSPATH' ) || exit;

add_shortcode( 'eight_scope_ai_html', function () {
    $file = __DIR__ . '/landing-content.html';
    if ( ! is_readable( $file ) ) {
        return '';
    }

    $html = file_get_contents( $file );
    return false === $html ? '' : $html;
} );

add_filter( 'template_include', function ( $template ) {
    if ( ! is_page( 'ai-landing' ) || is_embed() ) {
        return $template;
    }

    $page = get_queried_object();
    $blank_template = __DIR__ . '/blank-template.php';
    if ( ! has_shortcode( $page->post_content, 'eight_scope_ai_html' ) || ! is_readable( $blank_template ) ) {
        return $template;
    }

    add_action( 'wp_enqueue_scripts', function () {
        $url = plugin_dir_url( __FILE__ );
        wp_enqueue_style( 'eight-scope-ai-html', $url . 'landing.css', array(), '1.0.0' );

        if ( is_readable( __DIR__ . '/landing.js' ) ) {
            wp_enqueue_script( 'eight-scope-ai-html', $url . 'landing.js', array(), '1.0.0', true );
        }
    } );

    return $blank_template;
}, 99 );

The shortcode reads a local file with a fixed name. Only upload HTML and JavaScript you have reviewed and are ready to serve. Pay particular attention to external scripts and forms that send data. Hosting may serve these files directly to anyone with the address even while the WordPress page is a draft. Shortcode registration · WordPress template selection

blank-template.php

This is the minimal HTML wrapper. the_content() renders the page content and runs the shortcode. wp_head(), wp_body_open(), and wp_footer() keep the hooks that WordPress and plugins need for styles, scripts, and metadata. WordPress template hooks

<?php defined( 'ABSPATH' ) || exit; ?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
        <title><?php echo esc_html( wp_get_document_title() ); ?></title>
    <?php endif; ?>
    <?php wp_head(); ?>
</head>
<body <?php body_class( 'eight-scope-ai-html-page' ); ?>>
    <?php wp_body_open(); ?>
    <?php while ( have_posts() ) : the_post(); ?>
        <?php the_content(); ?>
    <?php endwhile; ?>
    <?php wp_footer(); ?>
</body>
</html>

landing-content.html

Start with this sample to test the connection. Then replace the content inside <main> with what was inside <body> in the original export. Keep the document wrapper (<!doctype html>, <html>, <head>, and <body>) in the template. If the export already includes <main>, give it the ID eight-scope-ai-landing and use it as the wrapper.

<main id="eight-scope-ai-landing" lang="en" dir="ltr">
    <h1>My landing page</h1>
    <p>If you see this text, the shortcode found the HTML file.</p>
</main>

landing.css and other assets

Save the contents of the page's <style> tag or stylesheet in landing.css. Move generic body and :root rules onto the page-specific body or #eight-scope-ai-landing as needed. The theme and other plugins can still load styles through wp_head(). Page-specific selectors help keep your rules focused on this content.

body.eight-scope-ai-html-page {
    margin: 0;
}

#eight-scope-ai-landing {
    max-width: 72rem;
    margin-inline: auto;
    padding: 2rem 1rem;
    font-family: system-ui, sans-serif;
}
  • For plain JavaScript, move local <script> contents into landing.js in the same folder. The plugin loads it at the bottom of the page. If the export uses import, React, or a build step, prepare a browser-ready build and load it accordingly. Enqueue styles and scripts
  • Store images, fonts, and other assets under an assets folder in the plugin. In HTML, a relative path such as assets/hero.webp is resolved relative to the page URL. Use the asset's actual public URL in src, such as https://example.com/wp-content/plugins/eight-scope-ai-html/assets/hero.webp. In landing.css, url("assets/font.woff2") resolves relative to the stylesheet. CSS URL resolution
  • Check the generated links and forms. An HTML form can look finished even if it has nowhere to submit its data.

4. Upload the files and choose how to activate them

Install as a plugin

In FileZilla, drag the whole eight-scope-ai-html folder into wp-content/plugins/ on the server. Confirm the main file ended up at wp-content/plugins/eight-scope-ai-html/eight-scope-ai-html.php. Transfer files with FileZilla

FileZilla · File transfer
Local site
C:\Projects\
eight-scope-ai-html
Remote site
/public_html/wp-content/plugins/
eight-scope-ai-html
Upload folderSuccessful transfers
Drag the plugin folder from your computer into wp-content/plugins/ on the server.

In WordPress admin, open Plugins → Installed Plugins and click Activate for 8SCOPE AI HTML Page. Install a WordPress plugin by uploading files

WordPress · Installed Plugins
PluginsInstalled Plugins
AllActiveInactive
Plugin
8SCOPE AI HTML Page
ActivateDelete
In Installed Plugins, click Activate under the plugin name.

Install inside the child theme

Upload the folder to wp-content/themes/my-site-child/eight-scope-ai-html/ using your own child theme directory name. Replace the line that uses plugin_dir_url() in eight-scope-ai-html.php with the following, and adjust the asset URLs in the HTML.

$url = get_stylesheet_directory_uri() . '/eight-scope-ai-html/';

Back up the child theme's functions.php. Add the following line inside the existing PHP block. If the file doesn't exist, create it with <?php on the first line. Upload it over SFTP. The code loads when the child theme is active. Pick one installation method so the shortcode and template hooks only register once. Child theme functions.php

require_once __DIR__ . '/eight-scope-ai-html/eight-scope-ai-html.php';

5. Create the page and add the shortcode

  1. In WordPress admin, open Pages → Add New Page, give the page a title, and save it as a draft. Check that the page slug is ai-landing. If you choose a different slug, update the value in is_page() to match.

  2. Add a Shortcode block and paste in the line below. WordPress Shortcode block

    [eight_scope_ai_html]
    
  3. Open Preview. Leave the template selector on its default. The code checks the page and the shortcode and swaps the template when the page is requested.

  4. After publishing, open the URL in a private window on desktop and mobile. Check images, links, and forms, and confirm the theme's menu and footer are absent. The admin bar may appear when you're signed in.

WordPress · Page editor
PagesAdd Page
AI Landing
Add blockShortcode
[eight_scope_ai_html]
PageBlock
Status
Draft
Slug
ai-landing
Template
Default template
Paste the shortcode into a Shortcode block and check that the slug is ai-landing.

Troubleshoot the result

  • The shortcode displays as text. Verify the plugin is active or the child theme's functions.php loads it. Check the shortcode spelling and make sure it's in a Shortcode block.
  • The menu and footer still appear. Check the page slug and blank-template.php filename on the server, then purge the page cache.
  • The template is empty. Check that landing-content.html sits beside the main PHP file and contains your fragment. If the sample HTML works, check whether your original export depends on a script or asset you haven't uploaded.
  • An image or stylesheet is missing. Open the browser developer tools and look for a 404 in Network. Compare the URL to the path and case-sensitive filename in SFTP.
  • An uploaded change still doesn't appear. Make sure you replaced the right file, purge the page cache, and bump the stylesheet or script version in the enqueue call so the browser requests the update.

To restore the standard page template, remove the shortcode and save the page. If a PHP change locks you out of admin, rename the plugin folder over SFTP to stop it loading. If you installed it in a child theme, restore the functions.php backup or remove the require_once line you added. Purge the page cache and retest.

Share

Have a project like this in mind?

Tell us what you need — we reply within one business day.

Start a conversation