DEV Community

Cover image for Turning WordPress Into an Open Knowledge Graph with OKF
Hamada Habib
Hamada Habib

Posted on

Turning WordPress Into an Open Knowledge Graph with OKF

For years, content management systems have been optimized for people and search engines.

Pages, posts, taxonomies, custom post types, categories, tags, and internal links all work well for publishing content on the web.

But modern AI systems need something different.

They need structure.

They need relationships.

They need knowledge.

This is where the Open Knowledge Format (OKF) becomes interesting.

The Problem

Most WordPress websites contain valuable knowledge.

A real estate website may contain:

  • Projects
  • Developers
  • Cities
  • Properties

A SaaS website may contain:

  • Features
  • Documentation
  • Guides
  • Integrations
  • FAQs

A university website may contain:

  • Courses
  • Departments
  • Professors
  • Research papers

The information exists.

The relationships exist.

But the knowledge is trapped inside HTML pages.

For humans, that is fine.

For AI systems, it is not ideal.

What Is OKF?

Open Knowledge Format (OKF) is an open specification introduced by Google Cloud as a lightweight way to represent knowledge using Markdown files.

Instead of storing knowledge in a graph database or a proprietary format, OKF uses:

  • Directories
  • Markdown documents
  • Metadata
  • Links

Every document becomes a concept.

Every link becomes a relationship.

The result is a portable and AI-friendly knowledge graph.

Why WordPress?

WordPress powers a large portion of the web.

Yet most WordPress content is still distributed as HTML.

If we can transform WordPress content into OKF documents, we gain:

  • Structured knowledge representation
  • Better AI ingestion
  • Portable knowledge graphs
  • Vendor independence
  • Human-readable storage
  • Git-friendly versioning

Building Knowledge Layer

To explore this idea, I built Knowledge Layer:

https://github.com/wooserv/wp-knowledge-layer

Knowledge Layer is a WordPress plugin that synchronizes WordPress content into Open Knowledge Format documents.

The goal is simple:

Transform WordPress content into a persistent Markdown-based knowledge graph.

The plugin supports:

  • Pages
  • Posts
  • Custom Post Types
  • Taxonomies
  • Internal links
  • Incremental synchronization

Instead of rebuilding everything repeatedly, content is synchronized as it changes.

How It Works

When content is published:

  1. WordPress content is discovered.
  2. HTML is converted into Markdown.
  3. Metadata is extracted.
  4. Internal links are rewritten.
  5. OKF documents are generated.
  6. The knowledge graph is updated.

The resulting files remain readable by both humans and AI systems.

Why Markdown?

Markdown provides several advantages:

  • Human-readable
  • Version controllable
  • Portable
  • AI-friendly
  • Easy to inspect
  • Easy to archive

Most importantly, Markdown does not require specialized infrastructure.

The Future

As AI systems increasingly consume structured knowledge, websites need more than pages and posts.

They need a way to expose their knowledge in an open and portable format.

OKF provides a promising foundation.

WordPress already contains the knowledge.

The next step is making that knowledge accessible.

Knowledge Layer is one attempt to bridge that gap.

References

Google Cloud:
https://cloud.google.com/blog/products/data-analytics/how-the-open-knowledge-format-can-improve-data-sharing

Open Knowledge Format Specification:
https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md

Community Resources:
https://suganthan.com/blog/open-knowledge-format/

GitHub:
https://github.com/wooserv/wp-knowledge-layer

Top comments (0)