Fulgid
Forum Replies Created
-
Hi @garrigan ,
Thank you for your understanding and for testing the plugin!
Since everything is working properly, would you be willing to leave a review for the plugin? Your feedback would be incredibly valuable and help other users
discover this tool.Thanks again for your help with testing!
Hi @garrigan ,
Those PHP messages are intentional debug logging in the prevent_llms_txt_redirect function. They’re designed to help troubleshoot URL redirect issues, but they
only appear when WP_DEBUG is enabled.To remove these messages, you have two options:
- Disable debug mode (recommended for production):
- In your wp-config.php file, change:
define('WP_DEBUG', true);todefine('WP_DEBUG', false);
- In your wp-config.php file, change:
- Remove the debug code from the plugin:
- Edit the plugin file and remove lines 259-261 and 266-268 (the error_log statements)
Thank you for the detailed feedback and testing!
You’re absolutely right about the regex precision. I’ve just released version 1.0.8 that implements your exact recommendations:
✅ Fixed: Now checks $redirect_url instead of $requested_url✅ Fixed: Only targets URLs with trailing slashes using /\/llms(-full)?.txt\/$/✅ Improved: More
surgical approach – only prevents redirects when WordPress tries to ADD trailing slashesYour analysis was spot-on – the previous pattern was too broad and caught both scenarios. The new version follows your proven approach of only intercepting
the problematic trailing slash redirects.Update available now on ww.wp.xz.cn – please test version 1.0.8 and let me know if this resolves the issue completely.
Really appreciate you taking the time to test and provide such detailed technical feedback. This kind of collaboration makes the plugin better for everyone!
Hi @garrigan ,
Thank you for those detailed screenshots! I can see exactly what’s happening now.I found the issue – there’s a bug in our v1.0.6 regex pattern that doesn’t handle all URL formats correctly.
Here’s what you need to do:
- Download the updated plugin (we’re releasing v1.0.7 with the fix)
- Or apply this quick fix manually: In your ai-content-guide.php file, find this line (around line 260):
if (preg_match(‘/\/llms(-full)?.txt\/?$/’, $requested_url)) { Replace it with:
if (preg_match(‘/(?:^|\/?)llms(-full)?.txt\/?$/’, $requested_url)) { - Clear all caches and test again What was wrong: The original regex required a forward slash before “llms” but WordPress sometimes passes URLs without it, causing the redirect prevention to fail. Your analysis was perfect – you correctly identified that return false; prevents the redirect. The issue was that our pattern wasn’t matching your URLs properly. The fix handles URLs in all these formats:
- yoursite.com/llms.txt
- yoursite.com/llms.txt/
- llms.txt (relative)
- /llms.txt (absolute) Let me know if this resolves the issue!
- This reply was modified 11 months ago by Fulgid.
Hi garrigan,
Great solution! I actually implemented something very similar in my LLMs Text Generator plugin. Your approach with the redirect_canonical filter is exactly right.
For anyone else facing this issue, here’s a slightly more precise version that specifically targets llms.txt files:
function my_plugin_prevent_llms_txt_redirect($redirect_url, $requested_url) {
// Check if this is a request for llms.txt or llms-full.txt files
if (preg_match(‘/\/llms(-full)?.txt\/?$/’, $requested_url)) {
return false; // Prevent redirect
}
return $redirect_url;
}
add_filter(‘redirect_canonical’, ‘my_plugin_prevent_llms_txt_redirect’, 10, 2);This uses regex to be more specific about which URLs to block redirects for, avoiding potential conflicts with other URLs that might contain “llms” in the path.
Thanks for sharing the solution and those helpful resources!
Thank you for reporting this issue with the trailing slash redirects on your llms.txt files. I’ve identified and fixed the root cause.
Problem:
WordPress was automatically adding trailing slashes to your llms.txt and llms-full.txt URLs through its canonical redirect functionality, causing unwanted 301 redirects
before our plugin could handle the requests.Solution:
I’ve updated the plugin code to prevent WordPress from redirecting these specific URLs. The fix adds a filter that intercepts the canonical redirect for llms.txt files and
prevents the automatic trailing slash addition.What was changed:
- Added redirect_canonical filter to prevent WordPress from redirecting llms.txt URLs
- Added prevent_llms_txt_redirect() method to handle the redirect prevention logic Expected behavior after update:
- https://staging.garriganenterprises.com/llms.txt → 200 OK (no redirect)
- https://staging.garriganenterprises.com/llms-full.txt → 200 OK (no redirect) This fix will be included in the next plugin update. The issue was not related to your NGINX configuration – it was WordPress’s default behavior that needed to be overridden.
Please test after the update and let me know if you encounter any further issues.
Forum: Reviews
In reply to: [LLMs Text Generator for WordPress] Cannot access settingsThank you for bringing this to our attention!
We’ve identified and resolved the issue causing the “Sorry, you are not allowed to access this page” error. The latest update (version 1.0.5) is now available, and it includes the necessary fix to restore proper access to the settings page.
We’re continuously working to make the LLMs Text Generator plugin as intuitive, efficient, and developer-friendly as possible. Your feedback helps us get there faster — so thank you again for reporting it!
Please feel free to try the updated version, and let us know if you encounter anything else. We’re here to help and improve.
- Disable debug mode (recommended for production):