Wordpress shows 404 page when saving new post or editing post












2















Problem is ... when I click on edit post/edit page, it tries to open http://localhost/site/wp-admin/post-108.php?post=286&action=edit and ends up on 404 page.
It also shows the 404 page when saving a new post/page.



I don't remember exactly what I did but it must have started after my IDE refactored the code when I was renaming a template file.



There is no post-108.php inside wp-admin folder or inside my theme folder, but there's post.php. I don't know why it is trying to open post-108.php which does not exist.



NOTE: It is a custom theme I am building myself using wordpress 4.7.4



Thank you all.










share|improve this question























  • try resetting your permalink to default then try once.

    – Raunak Gupta
    Apr 24 '17 at 7:05











  • I have tried all the permalink options, not working.

    – Peter O
    Apr 24 '17 at 7:21











  • how you have generated the post edit link?

    – Raunak Gupta
    Apr 24 '17 at 7:29











  • If I directly access the link localhost/site/wp-admin/post.php?post=286&action=edit, it opens properly the post or page with post-id 286 for editing. But when I click on save button, it saves the changes then redirects to localhost/site/wp-admin/post-108.php?post=286&action=edit which does not exist.

    – Peter O
    Apr 24 '17 at 7:40











  • I think you should deactivate all the plugin then try to debug. some plugin is altering the edit post link.

    – Raunak Gupta
    Apr 24 '17 at 7:42
















2















Problem is ... when I click on edit post/edit page, it tries to open http://localhost/site/wp-admin/post-108.php?post=286&action=edit and ends up on 404 page.
It also shows the 404 page when saving a new post/page.



I don't remember exactly what I did but it must have started after my IDE refactored the code when I was renaming a template file.



There is no post-108.php inside wp-admin folder or inside my theme folder, but there's post.php. I don't know why it is trying to open post-108.php which does not exist.



NOTE: It is a custom theme I am building myself using wordpress 4.7.4



Thank you all.










share|improve this question























  • try resetting your permalink to default then try once.

    – Raunak Gupta
    Apr 24 '17 at 7:05











  • I have tried all the permalink options, not working.

    – Peter O
    Apr 24 '17 at 7:21











  • how you have generated the post edit link?

    – Raunak Gupta
    Apr 24 '17 at 7:29











  • If I directly access the link localhost/site/wp-admin/post.php?post=286&action=edit, it opens properly the post or page with post-id 286 for editing. But when I click on save button, it saves the changes then redirects to localhost/site/wp-admin/post-108.php?post=286&action=edit which does not exist.

    – Peter O
    Apr 24 '17 at 7:40











  • I think you should deactivate all the plugin then try to debug. some plugin is altering the edit post link.

    – Raunak Gupta
    Apr 24 '17 at 7:42














2












2








2








Problem is ... when I click on edit post/edit page, it tries to open http://localhost/site/wp-admin/post-108.php?post=286&action=edit and ends up on 404 page.
It also shows the 404 page when saving a new post/page.



I don't remember exactly what I did but it must have started after my IDE refactored the code when I was renaming a template file.



There is no post-108.php inside wp-admin folder or inside my theme folder, but there's post.php. I don't know why it is trying to open post-108.php which does not exist.



NOTE: It is a custom theme I am building myself using wordpress 4.7.4



Thank you all.










share|improve this question














Problem is ... when I click on edit post/edit page, it tries to open http://localhost/site/wp-admin/post-108.php?post=286&action=edit and ends up on 404 page.
It also shows the 404 page when saving a new post/page.



I don't remember exactly what I did but it must have started after my IDE refactored the code when I was renaming a template file.



There is no post-108.php inside wp-admin folder or inside my theme folder, but there's post.php. I don't know why it is trying to open post-108.php which does not exist.



NOTE: It is a custom theme I am building myself using wordpress 4.7.4



Thank you all.







php wordpress wordpress-theming






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 24 '17 at 6:57









Peter OPeter O

2117




2117













  • try resetting your permalink to default then try once.

    – Raunak Gupta
    Apr 24 '17 at 7:05











  • I have tried all the permalink options, not working.

    – Peter O
    Apr 24 '17 at 7:21











  • how you have generated the post edit link?

    – Raunak Gupta
    Apr 24 '17 at 7:29











  • If I directly access the link localhost/site/wp-admin/post.php?post=286&action=edit, it opens properly the post or page with post-id 286 for editing. But when I click on save button, it saves the changes then redirects to localhost/site/wp-admin/post-108.php?post=286&action=edit which does not exist.

    – Peter O
    Apr 24 '17 at 7:40











  • I think you should deactivate all the plugin then try to debug. some plugin is altering the edit post link.

    – Raunak Gupta
    Apr 24 '17 at 7:42



















  • try resetting your permalink to default then try once.

    – Raunak Gupta
    Apr 24 '17 at 7:05











  • I have tried all the permalink options, not working.

    – Peter O
    Apr 24 '17 at 7:21











  • how you have generated the post edit link?

    – Raunak Gupta
    Apr 24 '17 at 7:29











  • If I directly access the link localhost/site/wp-admin/post.php?post=286&action=edit, it opens properly the post or page with post-id 286 for editing. But when I click on save button, it saves the changes then redirects to localhost/site/wp-admin/post-108.php?post=286&action=edit which does not exist.

    – Peter O
    Apr 24 '17 at 7:40











  • I think you should deactivate all the plugin then try to debug. some plugin is altering the edit post link.

    – Raunak Gupta
    Apr 24 '17 at 7:42

















try resetting your permalink to default then try once.

– Raunak Gupta
Apr 24 '17 at 7:05





try resetting your permalink to default then try once.

– Raunak Gupta
Apr 24 '17 at 7:05













I have tried all the permalink options, not working.

– Peter O
Apr 24 '17 at 7:21





I have tried all the permalink options, not working.

– Peter O
Apr 24 '17 at 7:21













how you have generated the post edit link?

– Raunak Gupta
Apr 24 '17 at 7:29





how you have generated the post edit link?

– Raunak Gupta
Apr 24 '17 at 7:29













If I directly access the link localhost/site/wp-admin/post.php?post=286&action=edit, it opens properly the post or page with post-id 286 for editing. But when I click on save button, it saves the changes then redirects to localhost/site/wp-admin/post-108.php?post=286&action=edit which does not exist.

– Peter O
Apr 24 '17 at 7:40





If I directly access the link localhost/site/wp-admin/post.php?post=286&action=edit, it opens properly the post or page with post-id 286 for editing. But when I click on save button, it saves the changes then redirects to localhost/site/wp-admin/post-108.php?post=286&action=edit which does not exist.

– Peter O
Apr 24 '17 at 7:40













I think you should deactivate all the plugin then try to debug. some plugin is altering the edit post link.

– Raunak Gupta
Apr 24 '17 at 7:42





I think you should deactivate all the plugin then try to debug. some plugin is altering the edit post link.

– Raunak Gupta
Apr 24 '17 at 7:42












2 Answers
2






active

oldest

votes


















2














Go through the below steps, may resolve your issue.




  1. First of all make sure that there is a file named as ‘post.php’ in ‘wp-admin’ folder.


  2. Then disable all Plugins and try again. If it works, enable each Plugin one by one to discover what is causing this issue.


  3. If the above one doesn’t help you, go to your ‘Admin > Settings > Permalinks’. Don’t change anything on that Permalinks page, but just click the button ‘Save Changes’ exists at the bottom. Now try to publish a post.


  4. If you still experience the issue, choose the option ‘Default’ in Permalinks page then save changes. After that you can set it again to the previous permalink option or keep it as Default as you wish. Then try to publish a post.


  5. If the problem exits however, check the “WordPress address (URL)” and “Blog address (URL)” have set correctly in ‘Settings > General’ (no slash at the end of the URLs).


  6. After that remove the link ‘http://rpc.pingomatic.com/‘ from the field ‘Update Services’ exists at ‘Settings > Writing’ and try again to publish a post.



  7. If problem appears yet with all above changes, copy the code given below and paste in the .htaccess file.
    Code to be Added





    RewriteEngine On

    RewriteBase /

    RewriteRule ^index.php$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /index.php [L]








share|improve this answer
























  • In .htaccess, I added the line Redirect /library/wp-admin/post-108.php /library/wp-admin/post.php so the entire .htaccess looks like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /site/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] Redirect /site/wp-admin/post-108.php /site/wp-admin/post.php </IfModule>

    – Peter O
    Apr 24 '17 at 10:36













  • This allows me to continue working but I know the real problem is still there. None of the other solutions seem to help.

    – Peter O
    Apr 24 '17 at 10:43





















1














I have not sorted this real solution as none of the above has worked for me. I do have work around.. If you can get to the Pages in the dashboard but the Posts gives you a 404 then just go to the Pages and replace the querysting.



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=page


change to:



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=post





share|improve this answer


























  • This was also my issue. I had to change my url from &post_type=post to &post_type=portfolio

    – elit3x
    Nov 24 '18 at 1:47













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43581655%2fwordpress-shows-404-page-when-saving-new-post-or-editing-post%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Go through the below steps, may resolve your issue.




  1. First of all make sure that there is a file named as ‘post.php’ in ‘wp-admin’ folder.


  2. Then disable all Plugins and try again. If it works, enable each Plugin one by one to discover what is causing this issue.


  3. If the above one doesn’t help you, go to your ‘Admin > Settings > Permalinks’. Don’t change anything on that Permalinks page, but just click the button ‘Save Changes’ exists at the bottom. Now try to publish a post.


  4. If you still experience the issue, choose the option ‘Default’ in Permalinks page then save changes. After that you can set it again to the previous permalink option or keep it as Default as you wish. Then try to publish a post.


  5. If the problem exits however, check the “WordPress address (URL)” and “Blog address (URL)” have set correctly in ‘Settings > General’ (no slash at the end of the URLs).


  6. After that remove the link ‘http://rpc.pingomatic.com/‘ from the field ‘Update Services’ exists at ‘Settings > Writing’ and try again to publish a post.



  7. If problem appears yet with all above changes, copy the code given below and paste in the .htaccess file.
    Code to be Added





    RewriteEngine On

    RewriteBase /

    RewriteRule ^index.php$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /index.php [L]








share|improve this answer
























  • In .htaccess, I added the line Redirect /library/wp-admin/post-108.php /library/wp-admin/post.php so the entire .htaccess looks like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /site/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] Redirect /site/wp-admin/post-108.php /site/wp-admin/post.php </IfModule>

    – Peter O
    Apr 24 '17 at 10:36













  • This allows me to continue working but I know the real problem is still there. None of the other solutions seem to help.

    – Peter O
    Apr 24 '17 at 10:43


















2














Go through the below steps, may resolve your issue.




  1. First of all make sure that there is a file named as ‘post.php’ in ‘wp-admin’ folder.


  2. Then disable all Plugins and try again. If it works, enable each Plugin one by one to discover what is causing this issue.


  3. If the above one doesn’t help you, go to your ‘Admin > Settings > Permalinks’. Don’t change anything on that Permalinks page, but just click the button ‘Save Changes’ exists at the bottom. Now try to publish a post.


  4. If you still experience the issue, choose the option ‘Default’ in Permalinks page then save changes. After that you can set it again to the previous permalink option or keep it as Default as you wish. Then try to publish a post.


  5. If the problem exits however, check the “WordPress address (URL)” and “Blog address (URL)” have set correctly in ‘Settings > General’ (no slash at the end of the URLs).


  6. After that remove the link ‘http://rpc.pingomatic.com/‘ from the field ‘Update Services’ exists at ‘Settings > Writing’ and try again to publish a post.



  7. If problem appears yet with all above changes, copy the code given below and paste in the .htaccess file.
    Code to be Added





    RewriteEngine On

    RewriteBase /

    RewriteRule ^index.php$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /index.php [L]








share|improve this answer
























  • In .htaccess, I added the line Redirect /library/wp-admin/post-108.php /library/wp-admin/post.php so the entire .htaccess looks like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /site/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] Redirect /site/wp-admin/post-108.php /site/wp-admin/post.php </IfModule>

    – Peter O
    Apr 24 '17 at 10:36













  • This allows me to continue working but I know the real problem is still there. None of the other solutions seem to help.

    – Peter O
    Apr 24 '17 at 10:43
















2












2








2







Go through the below steps, may resolve your issue.




  1. First of all make sure that there is a file named as ‘post.php’ in ‘wp-admin’ folder.


  2. Then disable all Plugins and try again. If it works, enable each Plugin one by one to discover what is causing this issue.


  3. If the above one doesn’t help you, go to your ‘Admin > Settings > Permalinks’. Don’t change anything on that Permalinks page, but just click the button ‘Save Changes’ exists at the bottom. Now try to publish a post.


  4. If you still experience the issue, choose the option ‘Default’ in Permalinks page then save changes. After that you can set it again to the previous permalink option or keep it as Default as you wish. Then try to publish a post.


  5. If the problem exits however, check the “WordPress address (URL)” and “Blog address (URL)” have set correctly in ‘Settings > General’ (no slash at the end of the URLs).


  6. After that remove the link ‘http://rpc.pingomatic.com/‘ from the field ‘Update Services’ exists at ‘Settings > Writing’ and try again to publish a post.



  7. If problem appears yet with all above changes, copy the code given below and paste in the .htaccess file.
    Code to be Added





    RewriteEngine On

    RewriteBase /

    RewriteRule ^index.php$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /index.php [L]








share|improve this answer













Go through the below steps, may resolve your issue.




  1. First of all make sure that there is a file named as ‘post.php’ in ‘wp-admin’ folder.


  2. Then disable all Plugins and try again. If it works, enable each Plugin one by one to discover what is causing this issue.


  3. If the above one doesn’t help you, go to your ‘Admin > Settings > Permalinks’. Don’t change anything on that Permalinks page, but just click the button ‘Save Changes’ exists at the bottom. Now try to publish a post.


  4. If you still experience the issue, choose the option ‘Default’ in Permalinks page then save changes. After that you can set it again to the previous permalink option or keep it as Default as you wish. Then try to publish a post.


  5. If the problem exits however, check the “WordPress address (URL)” and “Blog address (URL)” have set correctly in ‘Settings > General’ (no slash at the end of the URLs).


  6. After that remove the link ‘http://rpc.pingomatic.com/‘ from the field ‘Update Services’ exists at ‘Settings > Writing’ and try again to publish a post.



  7. If problem appears yet with all above changes, copy the code given below and paste in the .htaccess file.
    Code to be Added





    RewriteEngine On

    RewriteBase /

    RewriteRule ^index.php$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /index.php [L]









share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 24 '17 at 8:37









User7855069User7855069

1865




1865













  • In .htaccess, I added the line Redirect /library/wp-admin/post-108.php /library/wp-admin/post.php so the entire .htaccess looks like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /site/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] Redirect /site/wp-admin/post-108.php /site/wp-admin/post.php </IfModule>

    – Peter O
    Apr 24 '17 at 10:36













  • This allows me to continue working but I know the real problem is still there. None of the other solutions seem to help.

    – Peter O
    Apr 24 '17 at 10:43





















  • In .htaccess, I added the line Redirect /library/wp-admin/post-108.php /library/wp-admin/post.php so the entire .htaccess looks like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /site/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] Redirect /site/wp-admin/post-108.php /site/wp-admin/post.php </IfModule>

    – Peter O
    Apr 24 '17 at 10:36













  • This allows me to continue working but I know the real problem is still there. None of the other solutions seem to help.

    – Peter O
    Apr 24 '17 at 10:43



















In .htaccess, I added the line Redirect /library/wp-admin/post-108.php /library/wp-admin/post.php so the entire .htaccess looks like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /site/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] Redirect /site/wp-admin/post-108.php /site/wp-admin/post.php </IfModule>

– Peter O
Apr 24 '17 at 10:36







In .htaccess, I added the line Redirect /library/wp-admin/post-108.php /library/wp-admin/post.php so the entire .htaccess looks like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /site/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] Redirect /site/wp-admin/post-108.php /site/wp-admin/post.php </IfModule>

– Peter O
Apr 24 '17 at 10:36















This allows me to continue working but I know the real problem is still there. None of the other solutions seem to help.

– Peter O
Apr 24 '17 at 10:43







This allows me to continue working but I know the real problem is still there. None of the other solutions seem to help.

– Peter O
Apr 24 '17 at 10:43















1














I have not sorted this real solution as none of the above has worked for me. I do have work around.. If you can get to the Pages in the dashboard but the Posts gives you a 404 then just go to the Pages and replace the querysting.



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=page


change to:



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=post





share|improve this answer


























  • This was also my issue. I had to change my url from &post_type=post to &post_type=portfolio

    – elit3x
    Nov 24 '18 at 1:47


















1














I have not sorted this real solution as none of the above has worked for me. I do have work around.. If you can get to the Pages in the dashboard but the Posts gives you a 404 then just go to the Pages and replace the querysting.



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=page


change to:



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=post





share|improve this answer


























  • This was also my issue. I had to change my url from &post_type=post to &post_type=portfolio

    – elit3x
    Nov 24 '18 at 1:47
















1












1








1







I have not sorted this real solution as none of the above has worked for me. I do have work around.. If you can get to the Pages in the dashboard but the Posts gives you a 404 then just go to the Pages and replace the querysting.



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=page


change to:



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=post





share|improve this answer















I have not sorted this real solution as none of the above has worked for me. I do have work around.. If you can get to the Pages in the dashboard but the Posts gives you a 404 then just go to the Pages and replace the querysting.



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=page


change to:



https://YOURDOMAIN.com/wp-admin/edit.php?post_type=post






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 24 '18 at 6:28

























answered Apr 27 '18 at 0:26









EnkodeEnkode

2,67422138




2,67422138













  • This was also my issue. I had to change my url from &post_type=post to &post_type=portfolio

    – elit3x
    Nov 24 '18 at 1:47





















  • This was also my issue. I had to change my url from &post_type=post to &post_type=portfolio

    – elit3x
    Nov 24 '18 at 1:47



















This was also my issue. I had to change my url from &post_type=post to &post_type=portfolio

– elit3x
Nov 24 '18 at 1:47







This was also my issue. I had to change my url from &post_type=post to &post_type=portfolio

– elit3x
Nov 24 '18 at 1:47




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43581655%2fwordpress-shows-404-page-when-saving-new-post-or-editing-post%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Create new schema in PostgreSQL using DBeaver

Deepest pit of an array with Javascript: test on Codility

Costa Masnaga