How to convert WordPress to headless WordPress

A headless WordPress site is one that uses WordPress for content management and another custom frontend stack to display that content to site visitors. Using WordPress as a headless CMS is an innovative idea that is bringing more users into the WordPress ecosystem, and the main reason for this is that it can be integrated with almost any language or framework without sacrificing the strong editing capabilities that the majority of users are accustomed to. The marketing and content teams can use the WordPress interface while the development team can use their favorite tools like React and GraphQL in a familiar Git workflow with headless WordPress. Read this blog to learn more about the headless WordPress site. This article will demonstrate how to convert WordPress into a headless CMS.

Turning Wordpress to headless WordPress

To set up WordPress as a headless CMS, follow these steps:

  1. Log in to your WordPress site with an administrator account.
  2. On the Dashboard in the left sidebar, click Plugins, and then click Add New:

  3. Search for “headless mode” and then Install and activate the Headless Mode plugin:

  4. Log in to cPanel on a separate tab.

    If you do not know how to log in to your cPanel account, please see this article.
  5. In the FILES section of the cPanel home screen, click File Manager:

  6. In the left sidebar, click on the directory where the WordPress is installed, and then look for the wp-config. php file. Right click on the wp-config. php file, and click Edit:

  7. Insert the following line at the beginning of the file ( after the first set of comments), and the click save:

    define( 'HEADLESS_MODE_CLIENT_URL', 'REPLACE-WITH-YOUR-URL/wp-admin/' );
    
    Note: Be sure to change the URL to the actual URL for the front end of your site.It has to be at the beginning in order for it to work.

  8. On the WordPress Administration Dashboard, click on the Settings, and then click Permalinks:

  9. To redirect any request to the login page, set the Permalinks setting to Plain, and save the changes:

More Information

For more information about using headless WordPress, please visit: https://www.a2hosting.com/blog/what-is-a-headless-content-management-system-cms/

Get Managed WordPress Hosting

Article Details

Other Articles in This Category

Show More

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

Usamos cookies con el fin de personalizar para usted nuestro sitio Web y analizar el uso de éste. Usted acepta esto haciendo clic en “Acepto” o al continuar usando el sitio Web. Hay más información sobre cookies en nuestra política de privacidad.