Three WordPress bugs I hit while building a 200-tool AI directory (and how I fixed them)
I'm building AIBotRadar, a free directory of AI tools with comparison guides and daily news. It runs on WordPress with custom post types: ai_tool, ai_guide and ai_news. Most of the work is content, but three bugs cost me
I'm building AIBotRadar, a free directory of AI tools with comparison guides and daily news. It runs on WordPress with custom post types: ai_tool, ai_guide and ai_news. Most of the work is content, but three bugs cost me real time. Here they are, in case you hit them too.
1. Scheduled posts published immediately
I wanted 12 guides to go live two hours apart, so I set post_status to future and a future post_date through WP-CLI. They went live right away.
Cause: WordPress also looks at post_date_gmt. I only set the local date, and the GMT column stayed at 0000-00-00.
Fix: set both columns, and convert the time zone yourself:
wp_update_post( array(
'ID' => $id,
'post_status' => 'future',
'post_date' => $local, // site time zone
'post_date_gmt' => $gmt, // UTC
'edit_date' => true,
) );
After that, check that wp_next_scheduled( 'publish_future_post', array( $id ) ) returns a timestamp. If it returns false, nothing will fire. A system cron that runs wp cron event run --due-now every five minutes also makes the timing predictable.
2. The table of contents did nothing when clicked
The guide pages have a floating table of contents. Clicking it did nothing. Two causes, both mine:
- The script that opens the contents panel was never enqueued on the live site. It existed in the theme folder, so it worked on my local copy.
- A site-wide output filter added
target="_blank"to every link, including#sectionanchors, so each click tried to open a new tab instead of scrolling.
The filter now skips links whose href starts with #. I also added a small re-align step: lazy-loaded images above a heading push it down while the page is still scrolling, so after the jump I re-check the heading's position a few times.
3. Search engines learned about new pages slowly
Waiting for a crawler to find new pages is slow, so I added a small must-use plugin that pings IndexNow whenever a tool, guide or news post is published or updated. It hooks transition_post_status and sends the URL list on shutdown, so it doesn't slow the request. It also gave me an easy way to submit the whole sitemap once.
Two things to know. The key file must be served byte for byte, so a trailing newline from a script on Windows made the first verification fail with a 403. And IndexNow is not read by Google, so it helps Bing and some other engines, not everything.
Where it stands
204 tools, 32 categories, 66 guides and 96 news stories. In Search Console I'm at roughly 3,200 impressions and 12 clicks, with most pages sitting on page 2. I'm focusing on comparison and "alternatives" guides now, since those seem more reachable than single-tool pages.
If you have run a content site on WordPress, I'd like to hear what got your pages from page 2 to page 1.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.