SOLVED WordPress Toolkit Pro breaks LearnDash post types

Operating System & Version
CloudLinux v7.9.0
cPanel & WHM Version
100.0 (build 5)

karlemilnikka

Member
Jan 18, 2022
6
2
3
Sweden
cPanel Access Level
Website Owner
I’ve run into a very interesting issue. I manage our main WordPress site through cPanel’s WordPress Toolkit Pro. On this WordPress site, we run a popular LMS plugin called LearnDash. LearnDash extends WordPress native post types with post types for courses, lessons and topics.

Cloning our main site to our staging domain causes all courses to return 404s. Just saving the permalinks (/wp-admin/options-permalink.php) without making any changes solves the issue and the courses are back.

The interesting part is that permalink issue isn’t caused on the newly cloned staging site. It’s caused on the main live site!

I haven’t been able to narrow down what’s causing the issue. The LearnDash LMS has had permalink related issues before, but I’ve never seen anything like this. Does anyone have an idea on what’s causing it and why the live site, not the cloned site, is affected?
 

karlemilnikka

Member
Jan 18, 2022
6
2
3
Sweden
cPanel Access Level
Website Owner
Quick update. It’s actually enough to click refresh button in WordPress Toolkit Pro to break the permalinks. I’m currently looking into what combination of plugins and WP Toolkit that causes the issue.
 

karlemilnikka

Member
Jan 18, 2022
6
2
3
Sweden
cPanel Access Level
Website Owner
I just found what’s causing it. On sites that are centrally managed by WP Toolkit Pro, there seems to be an issue with custom post types if the plugin that added the post types isn’t loaded on the frontend. I previously blocked LearnDash from loading on all non-LearnDash related posts and pages to avoid unnecessary styles and scripts. That caused the permalinks to break every time WP Toolkit scanned the site, for example when the site was cloned. My solution was however a dirty work-around so there’s nothing wrong with neither LearnDash nor WP Toolkit Pro. I’ll just dequeue all unnecessary styles and scripts instead.
 
  • Like
Reactions: cPanelAnthony