DEV Community

Eric Haalo
Eric Haalo

Posted on

Building a price comparison website with Wordpress

I've worked with Wordpress for more than 10 years now, but mostly from a blogger and publisher point of view. Some years ago, I began learning to code to create better more data-driven Wordpress sites. In this post, I want to share some of the methods you can use to create a "price comparison" website.

Plugins can do a lot but not everything

Wordpress has come a long way since I first started using it. Drag and Drop is normal now and has made presenting data very easy, with plugins like Elementor. Combine that with WP All Import to import your feeds and FacetWP to allow interactive filtering and you've got the basics down.

If you go the feed route for your price comparison website, you'll invariably run into the problem of having data that isn't formatted the way you want it to be. Here's where being able to code is a big benefit. WP All Import allows you to write code directly in the import screen and use your custom functions, so that you can transform data into the same format.

Python framework might be a better choice

Regardless of the fact that Wordpress is easy to use and effective, there's a lot of stuff it can't do. On my website, BrugtPris.dk, I find the median price for used iPhones and compare with vendor prices.

I do this scraping with Python and the Panda library in combination with Numpy. This kind of data processing simply isn't possible with Wordpress. As a result, I have to create this data, upload with FTP to Wordpress and import. It's not an optimal solution. In fact, halfway through this project, I began to think I should scrap it and start over with Flask.

Flask, the lightweight Wordpress framework, of course isn't close to being as user friendly for publishing as Wordpress. In this case, with little need for publishing blog posts, it would probably have been a better solution.

No easy choice yet

If you want to create and advanced price comparison website, there are of yet, no frameworks or cms that are made for the purpose, so choosing the correct tools will be a value judgement. I've chosen Wordpress as my "frontend" and Python running data processing in the backend. As of now, I find that a working pragmatic solution.

Top comments (0)