When I first started giving talks at WordCamps about Angular and Single Page Applications (SPA) back in 2014, one of the most common questions I got was “What about SEO?”, and I never really had a great answer. There have always been some kind of workaround for SEO with AJAX or SPA’s, whether it was using a service like prerender.io or fine tuning your sitemap so Google could see the pages that would load.
WordPress has always been a great way to get a website up and running quickly. SEO has always played a large role in why people even started using WordPress to begin with. For me, WordPress used to be the blog platform I’d attach to a site just to help with the overall site SEO, and by blogging and writing articles, the sites I’d be helping work on would rank higher. WordPress has always been about creating content, and content is they key element for having good SEO, so why shift away from that?
There are other factors involved here like the technology of the stack itself, which I do not want to get into. In a nutshell, if you want to use WordPress to create a site with good SEO with minimal effort to get there, you shouldn’t make your whole website a Single Page Application
When I was building what was CodeCavalry I knew that only part of the site, or the app itself, needed to be highly functional. So I created a single page that housed the AngularJS application which powered 90% of the site. It communicated with WordPress so user login would transition, and it could be incorporated well. Think of the app as a standalone website, built into my larger WordPress website. The rest of the site which included the home, about, contact, etc. pages were all just regular WordPress pages. Each of these had a small AngularJS application built into the header just to synchronize the user, but that was about it. When I wanted to add a blog, I just added a blog and it was also just regular WordPress with the Yoast SEO plugin to help out with some of the SEO settings.
Not everyone has the needs I had with CodeCavalry, but it does come up once in a while. Someone wants to build some web-app with WordPress (which is a great idea), and want to use the latest tech for the application. In a lot of these cases the business or what their customers are paying for, is the app. Whatever their application does, that is what they are going to sell.
With CodeCavalry it was the ability to get quick help using video conferencing and chat, for an affordable price. Great, so now that they have their business model and MVP idea in place, they want to take over all of WordPress to power it. Which is not a great idea.
Separating out the application into its own part of the site is much more flexible way to work. It can be anything from a separate sub-directory, not even WordPress, powered by the WordPress REST API. It can also be in the theme itself, utilizing a page template to mark the app page. This is a win win for the marketing & SEO side, and the development. It is a modular way to setup your website and application. It allows for the application to be developed or worked on irrelevant of any work that is needed to the rest of the site.
Marketing engineers can develop new pages, or utilize plugins without worrying about affecting the application, which is the business’s bread and butter. The pages that are outside of the application are also just regular server-side rendered WordPress, so you get all the easy SEO.