admin管理员组

文章数量:1297091

I've a bug that I cannot reproduce on my local/staging evn and occurs only on prod(having the same code, db and files). Here is what I get when visiting all of the default post types/taxonomies or custom created by me or plugins(it's not bugged on settings pages for ex):

When visiting /wp-admin/edit.php?post_type=page the page loads as it should, immediately after it load the URL changes to

/wp-admin/edit.php?post_type=page%3Fpost_type%3Dpage

therefore any further action in this window will lead to Invalid post type. Updating the core and all of the plugins, or removing all of them didn't fixes the issue. Couldn't find anything related in the debug.log. Only when I disable my browser JS it's working fine, but I don't load any custom script to the wp admin.

I'll really appreciate if someone can give a hint, thanks in advance.

I've a bug that I cannot reproduce on my local/staging evn and occurs only on prod(having the same code, db and files). Here is what I get when visiting all of the default post types/taxonomies or custom created by me or plugins(it's not bugged on settings pages for ex):

When visiting /wp-admin/edit.php?post_type=page the page loads as it should, immediately after it load the URL changes to

/wp-admin/edit.php?post_type=page%3Fpost_type%3Dpage

therefore any further action in this window will lead to Invalid post type. Updating the core and all of the plugins, or removing all of them didn't fixes the issue. Couldn't find anything related in the debug.log. Only when I disable my browser JS it's working fine, but I don't load any custom script to the wp admin.

I'll really appreciate if someone can give a hint, thanks in advance.

Share Improve this question edited Apr 12, 2018 at 12:53 Oleg Butuzov 3,21418 silver badges17 bronze badges asked Apr 12, 2018 at 12:09 KulirajKuliraj 1887 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

What you can do is copy live DB, and deploy it to dev. Once you do that, start to disabling plugins one by one to see which one causes an error. If it doesn't help - check where else you have code injections ( theme or drop-in or must use plugins). If it doesn't help you need to perform the same actions on live (which isn't better solution). I would suggest to open (with js disabled page "/wp-admin/edit.php?post_type=page" and see what js file and code included - from which plugins, this will be a massive hint where to search next.)

Posting the solution I've found for my problem.

It appears that we have mod_security on our prod env, and recommended clause is to replace "server info" and on what the site is hosted on(for security reasons).

In my case it was replaced with IIS 6, and that tricked the WordPress installation as well, which on it's end is doing additional URL optimizations...

本文标签: Additionally added URL params leading to quotInvalid post typequot in the Admin Panel