Guide · Updated September 2026

How to Convert a Nuxt Site to WordPress: A Technical Guide

Converting a Nuxt.js site to a WordPress theme primarily involves re-implementing the Nuxt site's static and dynamic elements using WordPress's theme structure and PHP templating system. The most straightforward approach is to replicate the Nuxt site's visual layout and functionality within a new, custom WordPress theme, fetching dynamic content from WordPress's backend.

Do it yourself in about a minute

Install Themify and get your first conversion free — no credit card.

Chrome browser logoAdd to Chrome — free

Understanding the Nuxt to WordPress Conversion Challenge

While both Nuxt.js and WordPress are powerful platforms for web development, they operate on fundamentally different architectures. Nuxt is a JavaScript framework, typically rendering content client-side or server-side (SSR) and interacting with APIs, often headless CMSs or custom backends. WordPress, on the other hand, is a PHP-based content management system (CMS) that generates HTML on the server and relies on its own database structure and templating engine (the Loop) to display content.

The core challenge in converting a Nuxt site to WordPress isn't a direct translation but rather a re-engineering process. You're not "porting" Nuxt code to PHP; instead, you're taking the visual design, user experience, and static assets of your Nuxt site and recreating them as a WordPress theme. The dynamic data that your Nuxt app once fetched from an API will now be managed and delivered by WordPress's robust content management system. This process allows you to leverage WordPress for content authoring and administration while maintaining the familiar look and feel of your Nuxt-built frontend.

This conversion is particularly beneficial if you want to empower non-technical users to manage content, leverage WordPress's extensive plugin ecosystem for SEO, security, or e-commerce, or consolidate your site's backend with other WordPress-powered properties.

Phase 1: Setting Up Your WordPress Development Environment

Before you begin translating your Nuxt site's design, you need a local WordPress environment. This will serve as your sandbox for theme development and testing. Using a local setup ensures that any changes you make don't impact a live site and allows for rapid iteration.

Choose a reliable local server solution. For Mac users, Local by Flywheel or MAMP are popular choices. For Windows users, XAMPP or Laragon are excellent. Ensure your chosen solution provides PHP (version 7.4 or higher recommended for modern WordPress), MySQL (or MariaDB), and Apache or Nginx.

Once your local server is running, download the latest version of WordPress from wordpress.org. Create a new database for your WordPress installation through your local server's database management tool (e.g., phpMyAdmin). Complete the standard WordPress installation by navigating to your site's URL (e.g., `http://localhost/yoursite`) and following the on-screen prompts, providing your database credentials and site information.

With WordPress installed, navigate to `wp-admin` and log in. You should see the default WordPress dashboard, ready for theme development.

Phase 2: Creating Your Custom WordPress Theme Structure

WordPress themes require a specific file structure and essential files to function. You'll start by creating a new directory for your theme within the WordPress theme folder and populating it with the bare minimum required files. This is where you'll begin to house your Nuxt site's design elements.

All WordPress themes reside in `wp-content/themes/`. Create a new folder here, named descriptively (e.g., `your-nuxt-theme`). Inside this folder, you need at least two files:

1. `style.css`: This is the primary stylesheet and contains crucial theme information.

2. `index.php`: This is the main fallback template file for your theme.

Additionally, it's good practice to immediately add `functions.php` for theme-specific functionality and `screenshot.png` for a visual representation in the WordPress admin.

Open `style.css` and add the following header comments. This block is critical for WordPress to recognize your theme:

```css /* Theme Name: Your Nuxt Theme Theme URI: http://your-website.com/your-nuxt-theme Author: Your Name Author URI: http://your-website.com Description: A custom WordPress theme converted from a Nuxt.js site. Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: your-nuxt-theme Tags: custom, nuxt, responsive */ body { /* Your Nuxt site's base styles will go here or be imported */ } ```

Next, create a basic `index.php` file. This will be the starting point for rendering content.

```php <?php get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); the_title( '<h2>', '</h2>' ); the_content(); endwhile; else : _e( 'Sorry, no posts matched your criteria.', 'your-nuxt-theme' ); endif; ?> </main><!-- #main --> </div><!-- #primary --> <?php get_footer(); ?> ```

Finally, create `functions.php` to enqueue scripts and styles. This file will be crucial for bringing your Nuxt site's assets into WordPress.

```php <?php function your_nuxt_theme_scripts() { wp_enqueue_style( 'your-nuxt-theme-style', get_stylesheet_uri(), array(), '1.0.0' ); // More styles and scripts will be enqueued here } add_action( 'wp_enqueue_scripts', 'your_nuxt_theme_scripts' ); // Placeholder for additional theme setup function your_nuxt_theme_setup() { add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); register_nav_menus( array( 'primary' => esc_html__( 'Primary Menu', 'your-nuxt-theme' ), ) ); } add_action( 'after_setup_theme', 'your_nuxt_theme_setup' ); ```

Activate your theme: In your WordPress admin, go to Appearance → Themes. You should now see "Your Nuxt Theme" listed. Click "Activate."

Phase 3: Migrating HTML Structure and CSS Assets

This phase involves copying the visual blueprint of your Nuxt site into your new WordPress theme. You'll extract the core HTML layout, global styles, and any specific component styles.

First, identify the main layout of your Nuxt site. In a typical Nuxt project, this might be in `layouts/default.vue`. Isolate the static HTML structure (header, footer, main content area) from the dynamic Vue components. Translate this static HTML directly into WordPress template files.

Steps for HTML migration:

1. **Header (`header.php`):** Create `header.php` and move your Nuxt site's global header HTML into it, along with the `<!DOCTYPE html>`, `<html>`, `<head>`, and opening `<body>` tags. Crucially, insert `<?php wp_head(); ?>` just before `</head>` to allow WordPress to inject its necessary scripts and styles.

2. **Footer (`footer.php`):** Create `footer.php` and move your Nuxt site's global footer HTML, along with the closing `</body>` and `</html>` tags. Insert `<?php wp_footer(); ?>` just before `</body>`.

3. **Main Content (`index.php`, `page.php`, `single.php`):** The remaining content will go into various template files. Your `index.php` (created earlier) can serve as the default. If your Nuxt site has distinct page and single post layouts, create `page.php` and `single.php` respectively, replicating their unique structures.

Next, gather all CSS files from your Nuxt project. This might include global stylesheets, utility classes, and component-specific styles. Copy these into a `css` folder within your theme directory.

Open `functions.php` and modify `your_nuxt_theme_scripts()` to enqueue these styles. Ensure paths are correct using `get_template_directory_uri()`.

```php function your_nuxt_theme_scripts() { wp_enqueue_style( 'your-nuxt-theme-style', get_stylesheet_uri(), array(), '1.0.0' ); wp_enqueue_style( 'your-nuxt-global-styles', get_template_directory_uri() . '/css/global.css', array(), '1.0.0' ); wp_enqueue_style( 'your-nuxt-component-styles', get_template_directory_uri() . '/css/components.css', array(), '1.0.0' ); // For JavaScript, if any static scripts are needed wp_enqueue_script( 'your-nuxt-scripts', get_template_directory_uri() . '/js/main.js', array('jquery'), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'your_nuxt_theme_scripts' ); ```

For responsive design, adapt media queries and flexible layouts from your Nuxt setup. If your Nuxt site used a CSS framework like Tailwind CSS or Bootstrap, you'll need to include those framework files or their compiled output in your `css` directory and enqueue them similarly. Remember to copy any images, fonts, or other static assets into appropriate folders (e.g., `img`, `fonts`) within your theme directory and update their paths in your CSS or HTML to use `get_template_directory_uri()`.

Phase 4: Integrating Dynamic Content with The WordPress Loop

The heart of any WordPress theme is The Loop, which retrieves and displays content from the database. Your Nuxt site likely fetched dynamic data from an API; now, WordPress will manage and output this content directly.

Identify where dynamic data (post titles, content, images, custom fields) was rendered in your Nuxt components. Replace these sections in your WordPress template files (e.g., `index.php`, `single.php`, `page.php`, `archive.php`) with the appropriate WordPress template tags and The Loop.

Common WordPress Loop tags:

<ul> <li><code>the_title()</code>: Displays the post title.</li> <li><code>the_content()</code>: Displays the main post content.</li> <li><code>the_permalink()</code>: Displays the URL of the post.</li> <li><code>the_post_thumbnail()</code>: Displays the featured image.</li> <li><code>the_excerpt()</code>: Displays a summary of the post.</li> <li><code>get_template_part()</code>: Includes template partials (e.g., for reusable post layouts).</li> </ul>

Example for `index.php` (showing a list of posts):

```php <?php get_header(); ?> <div class="container"> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php if ( has_post_thumbnail() ) : ?> <div class="post-thumbnail"> <?php the_post_thumbnail( 'medium' ); // Or specify a custom size ?> </div> <?php endif; ?> <div class="entry-content"> <?php the_excerpt(); // Or the_content() if you want full content on index ?> </div> <a href="<?php the_permalink(); ?>" class="read-more">Read More</a> </article> <?php endwhile; ?> <?php the_posts_pagination(); // Optional: Add pagination ?> <?php else : ?> <p><?php _e( 'Sorry, no posts found.', 'your-nuxt-theme' ); ?></p> <?php endif; ?> </div> <?php get_footer(); ?> ```

If your Nuxt site used custom post types or advanced custom fields (ACF), you'll need to replicate these in WordPress. Install the ACF plugin and create the same custom fields. Then, use ACF's PHP functions (`get_field()`, `the_field()`) within your theme templates to retrieve and display that data.

This is also an opportune moment to consider Themify. If your Nuxt site's design is purely visual and static in nature (i.e., not heavily reliant on complex JS interactions for its core layout), Themify could expedite this step significantly. By simply browsing your live Nuxt site with Themify, you can generate a base WordPress theme zip that captures its entire visual structure, including animations and fonts. You can then download this theme and proceed to integrate The Loop for dynamic content in the generated PHP files, saving hours on manual HTML/CSS migration.

Phase 5: Replicating Nuxt Features in WordPress

Nuxt.js provides many features out-of-the-box that need to be re-implemented or replaced with WordPress equivalents. This includes routing, SEO meta tags, and potentially more complex JavaScript functionalities.

**Routing:** WordPress handles routing through its permalink structure and template hierarchy. Instead of Nuxt's `pages/` directory, WordPress uses files like `index.php`, `single.php`, `page.php`, `category.php`, `archive.php`, `search.php`, and `404.php`. Ensure you have appropriate template files for each unique layout your Nuxt site had.

**SEO Meta Tags:** Nuxt often uses `head()` methods for dynamic meta tags. In WordPress, these are typically handled by SEO plugins (like Yoast SEO or Rank Math) or directly in your `functions.php` and `header.php`. The `title-tag` theme support automatically manages the `<title>` tag. For other meta tags, you might manually add them to `header.php` or use plugin-provided hooks.

**JavaScript Functionality:** This is the most complex part. If your Nuxt site had intricate client-side interactions, form validations, or dynamic content loading via JavaScript, you have a few options:

1. **Re-write in vanilla JavaScript/jQuery:** For simpler interactions, re-implement them using native browser APIs or jQuery (which is bundled with WordPress). Enqueue your custom JavaScript files in `functions.php`.

2. **Vue.js in WordPress:** For more complex, component-based interactions, you can embed individual Vue.js components into your WordPress theme. This involves compiling your Vue components into standalone JavaScript bundles and enqueueing them, then mounting them onto specific HTML elements in your WordPress templates. This requires careful build process integration.

3. **Modern JavaScript Framework (e.g., React/Vue) with WordPress REST API:** For heavily interactive sections or if you want to maintain a true decoupled frontend, you could use WordPress purely as a headless CMS, exposing its content via the REST API, and build a new Nuxt or Vue/React application that consumes this API. However, this is more of a re-architecture than a direct conversion and often unnecessary if the goal is a fully integrated WordPress theme.

When dealing with JavaScript, always use `wp_enqueue_script()` in `functions.php` to include your scripts. Pass `true` as the fifth argument to load scripts in the footer, improving performance.

Phase 6: Testing, Refinement, and Performance Optimization

Once you've converted the core structure, assets, and dynamic content, thorough testing is essential. This ensures that your converted WordPress theme behaves as expected and matches the original Nuxt site's functionality and aesthetics.

**Testing Checklist:**

<ul> <li>**Visual Fidelity:** Compare each page of your converted WordPress site with the original Nuxt site. Pay close attention to layouts, typography, spacing, colors, and image rendering. Use browser developer tools to inspect and debug CSS discrepancies.</li> <li>**Responsiveness:** Test on various screen sizes and devices to ensure the design remains fluid and responsive, just as it was in Nuxt.</li> <li>**Dynamic Content:** Verify that all posts, pages, custom post types, and custom fields are displayed correctly through The Loop. Check pagination, category archives, and search results.</li> <li>**Navigation:** Ensure all menus and links work as intended. Use WordPress's Appearance → Menus to configure navigation.</li> <li>**Forms:** Test all forms (contact forms, search forms, comments) to ensure submission and validation work correctly.</li> <li>**JavaScript Interactions:** Verify that any re-implemented JavaScript (sliders, accordions, lightboxes, AJAX calls) functions without errors. Check the browser console for JavaScript errors.</li> <li>**Plugin Compatibility:** If you plan to use specific WordPress plugins, test them with your new theme to ensure there are no conflicts.</li> </ul>

**Performance Optimization:** WordPress, when not optimized, can be slower than a highly optimized Nuxt static site. Implement best practices to maintain good performance:

<ul> <li>**Image Optimization:** Use plugins like Smush or EWWW Image Optimizer to compress images, and ensure images are served in modern formats (WebP) and appropriate sizes.</li> <li>**Caching:** Implement a robust caching solution (e.g., WP Super Cache, W3 Total Cache, LiteSpeed Cache) to serve cached versions of your pages, reducing server load.</li> <li>**Minification and Concatenation:** Minify your CSS and JavaScript files to reduce file sizes. Many caching plugins offer this functionality.</li> <li>**Lazy Loading:** Implement lazy loading for images and iframes to improve initial page load times. WordPress 5.5+ includes native lazy loading for images.</li> <li>**Database Optimization:** Regularly clean your WordPress database using plugins like WP-Optimize.</li> <li>**CDN:** Consider using a Content Delivery Network (CDN) to serve your static assets globally, reducing latency for users worldwide.</li> </ul>

By systematically testing and optimizing, you can ensure your converted WordPress theme delivers a seamless and performant user experience, mirroring the quality of your original Nuxt site.

Frequently asked questions

Can I directly convert Nuxt.js components into WordPress blocks (Gutenberg)?
Direct conversion is not possible as Nuxt components are Vue.js-based and WordPress blocks are React-based. You would need to re-develop your Nuxt components as custom Gutenberg blocks using React and the WordPress block API, which is a significant undertaking.
What about the Nuxt backend (e.g., headless CMS)? How does that work with WordPress?
If your Nuxt site used a headless CMS, you would migrate that content into the WordPress database through its admin interface or via custom scripts. WordPress then becomes the new content backend, managing all data that was previously handled by your headless CMS.
Is it possible to keep my Nuxt frontend and use WordPress as a headless CMS?
Yes, absolutely. This is a common and often recommended approach for modern, high-performance sites. You would configure WordPress to expose its content via the REST API or GraphQL (with a plugin like WPGraphQL), and your Nuxt application would then fetch and display that data without needing to create a WordPress theme.
How do I handle Nuxt modules like `axios` or `vuex` in WordPress?
Nuxt modules like `axios` (for HTTP requests) or `vuex` (for state management) are part of the Nuxt application's JavaScript frontend. When converting to a WordPress theme, these modules are typically not directly carried over. Instead, WordPress handles data fetching via PHP and The Loop, and any client-side state management or AJAX calls would be re-implemented using standard JavaScript, jQuery, or potentially by embedding smaller, focused Vue.js components within the WordPress theme if necessary.

Try it in minutes — first conversion free

Themify is the fastest way to turn any live webpage into an installable WordPress theme (.zip). No coding, no rebuilding, no design handoff. Runs 100% locally in your browser.

No credit card required · 14-day money-back guarantee

Chrome browser logoAdd to Chrome — 1 free conversion