Forem Creators and Builders

loading...

Add microdata to articles

Alvaro Montoro
・3 min read

Feature request

Adding microdata attributes to Forem's articles as described in Schema.org.

Summary

The posts from Forem communities could use the Article type from Scheme.org to structure the data and create relationships within the content. Regular users wouldn't see a difference, but the page would get a semantic boost beyond HTML5, which would be good for SEO and other sites to get detailed information.

That way, the article would be associated with:

  • The person who created it (author),
  • The dates of publication and modification (datePublished and dateModified respectively),
  • The tags that classify it (keywords),
  • The publisher when articles are posted in the name of a publication (publisher), etc.

Why is it needed?

There is an integration issue between Medium and DEV/Forem. If I go to Medium and import a story from DEV, the date is always wrong. In particular, the article's date is not the DEV article's date, but the date the user joined DEV.

This seems to happen –and this is me speculating– because the articles don't clearly identify which of the many dates on the page is the article's date. Then, Medium picks the first one available as the article's date, which happens to be the author's information signup date:

Screenshot of an article on DEV

The underlined name hides a user popup similar to the one of the right
 

Medium then imports the article to their site, but the date is wrong. For example, the article from the image above was published on August 29, 2021, but Medium will claim it was published on April 27, 2019:

Screenshot of Medium showing an article imported from DEV


Woops! The date is wrong!
 

This is a problem because articles exported to Medium will have old dates and won't appear as new on that platform. However, there's a workaround: users could copy Forem's articles and paste them onto Medium, but then the canonical reference to Forem would be lost.

Suggested solution(s)

This is most likely an issue on Medium-side, but it could potentially be prevented by making some changes on Forem-side. I could think of two options:

  1. Switching the order of author's info and publication date in the code (visually they could stay the same):

    Screenshot of DEV article with code

    It looks the same but the order in code has changed
     

    This would be a simple solution, and it could work, but it could also have some accessibility implications (the order in the code does not match the order on display). Plus, it may or may not work when importing from Medium.

  2. Adding microdata to the articles. Again, this may or may not work with Medium, but it would help with SEO and importing to other platforms.

    Screenshot of DEV article with added microdata attributes

    Microdata won't cause a visual change
     

    The microdata solution is a bit more complex, but it has additional benefits that just reorganizing the content doesn't have (it facilitates processing by computers which may boost indexing/SEO and importing from other sites).

Related issue(s)/PR(s)

N/A

Discussion (1)

Collapse
michaeltharrington profile image
Michael Tharrington

Thanks so much for sharing this feedback Alvaro! Medium is such a highly used platform and it'd be really nice to have imports working as smoothly as possible. I'll make sure that the team sees this one. 🙂