You know how people tell you that you should never take internet advice?steemCreated with Sketch.

in #ruby7 years ago (edited)

wtf-1934220_1280.jpg

I have to admit something, and it pains me to do it. I haven't spent a lot of time with Ruby over the last decade or so. So, naturally, it's a deficiency I'm aware of, and I started doing some research and coursework on it. And, since I'm a good little polyglot, I picked it up quickly. Ruby's actually stupidly easy. I think most programmers would feel that way, if they picked it up.

You know what programmers don't usually find easy? SEO. It's a maze of nonsense and voodoo that often causes reasonable people to come to some unreasonable solutions. It's true what they say... never take advice from the internet without getting a second opinion.

Case and point: I found this great little article at Hackernoon (a site that's normally at least decent), that advocates setting up Wordpress on your fresh new Ruby site. Even goes so far as to tell you how to break Wordpress to do it "properly," and in doing so violates everything that is good and pure in the universe. It's an exercise in wtf, and a reminder that you can say anything confidently, even if you're an ignorant moron. The moron in question is Paul Arterburn, and the article, entitled "Wordpress Inside a Ruby on Rails App" can be found here.

I think it's important to point out why I think Paul is an idiot for publishing this, so I'm not just calling him names. Let's start with the fact that he claims Wordpress is good for SEO. Does that claim have any merit? Seems spurious, so why don't we try to get to the bottom of it?

Truth is, bullshit content on the internet is a scourge, and it needs to be eradicated. Google is morally correct in its treatment of bullshit content, and I think they need to be more aggressive about stomping it out than they are.

Unless you've figured out some way to get your bullshit content to rank, be it on Steemit, or Wordpress, or wherever, it's never going to do anyone any good, and you're probably wasting your time creating it. There's no amount of bot usage or seo that will save you from bullshit content. But, the sentiment in SEO circles still seems to be that if you do certain things right, you'll still get a ton of high quality free traffic from Google, straight to your bullshit content, and we'll all start farting roses and having fat bank accounts.

It's like a kind of sick, ill-informed religion that still spreads, despite the fact that it hasn't been true for years. And the platform you're using to post your bullshit content doesn't matter. Wordpress won't save you, I'm sorry to be the bearer of bad news, but it's true. If you're writing low quality bullshit content, nobody's ever going to want to read it.

That said, Wordpress does a lot of things right structurally, that will help you with your SEO. It uses canonical linking, structured data, open graph tags, breadcrumbs, and it makes it easy to implement features like Sitemaps, and RSS feeds which are useful for getting your website spidered by Google Search Console. None of that will save you if you haven't created a website worth reading, but that's neither here nor there.

Even then, the results you get are going to depend on which Wordpress theme you're using, who built it, when they built it, and sadly... how much you paid for it. It's not a bad thing. Just a reality to using the platform. Not all themes are created equal. When it comes to SEO, there are good themes and bad themes in the Wordpress sphere.

I find it more than a little bit insulting as a reader that something this sparse can be written in the first place without a deluge of negative comments calling Paul out for the bad advice he's giving us. Then again, maybe that's why the comments were disabled on this one.

You might get the impression reading this shameless Flywheel plug that Paul doesn't actually understand why Wordpress delivered improved search results for his site. Instead, he thinks of it as a magic bullet that somehow just works, without taking the time to understand why it's delivering better results. Or, why it's an such an incredibly bad idea to do on a production website. If that's you're takeaway, you're probably right. My gut feeling here is that Paul might know how to write a Ruby app, but he doesn't know a damned thing about Wordpress or SEO.

Why is adding Wordpress to a Ruby website a bad idea?

Well, for starters, it's unnecessary. If you want a blog for a Ruby based website, write one in Ruby. If there are any security holes in it, they're yours, under your control, and you own them... for better or worse.

You don't need it

There's nothing in Wordpress that you really need Wordpress to do for SEO. If you care about SEO, you're going to be implementing a lot of the things in Wordpress on your own in Ruby anyway. RSS feeds, Sitemaps, Breadcrumbs, Canonicals, Open Graph, etc. can and should all be implemented within your own application.

And if you did all of it together, in one place, the way Wordpress does (again, often, but not always), you would have the same results, without opening up your system to new vulnerabilities, or the need to support a second application platform that will consume precious server/cloud resources, and slow down your website.

Security Holes

I've been working on building and extending Wordpress sites for a decade and a half. The technology has come a long way, and the Wordpress core is more stable, faster, and secure than it's ever been. At the time of this writing, I can say without reservation that the core system is safe to install anywhere. But let's be honest for a minute. How many serious websites do you know of that stick to the vanilla install?

PHP itself is an incredibly powerful and flexible language, but even now, there are millions of developers out there who simply don't understand how to use the tool responsibly. Anyone can write a Wordpress plugin. It's not difficult to do. I've written hundreds of them myself. As it happens, writing a Wordpress plugin or theme is among the first things new PHP developers try to do in order to teach themselves how to write code.

And so, is it any wonder why 73.2% of the most popular plugins for Wordpress have known security vulnerabilities? I mean, just think about it.

The answer should be glaring. By introducing Wordpress to your Ruby environment, or any non-native environment for that matter (let's leave Wordpress.Net out of it for now), you're not only buying into the imagined SEO benefits, which you should already know enough to implement in some shape or form yourself, but you're buying into a 20 year security legacy that is beyond your control, and potentially... making yourself a target the moment your start customizing it.

Resources and Performance

Ruby's already pretty heavy, as these things go. And it's no secret that Wordpress is a memory hog. It's gotten better in maturity, but it's still big and slow, requiring workarounds like script optimization, DNS-prefetching and CDN caches to deliver content in a fast cost effective matter. The bigger your Wordpress site, the more issues like this you're going to run into as you approach scale. If we're talking about sharing other resources like database servers, and so on, it's a problem that's only going to get worse before it gets better.

Run Wordpress and your Ruby app together, on the same domain prefix, on the same server (as recommended in the article), and it's only a matter of time before you're going to run into memory issues.

If you're on a platform like Heroku, it's not a huge problem. Throw money at it, and the memory issues disappear. But then you're paying to solve a problem that you never should have had in the first place.

Conclusion

If you want SEO on your websites, learn how to do SEO, and build it into your Ruby app yourself. You'll have one more thing to put on the resume, and you won't lose any sleep over it.