Hi there,
This might happen due to restricting file and directory permissions. I would suggest to first check that the permission for directories subdirectories in your WordPress installation is set to “755”. This includes wp-content, plugins, wp-includes, etc. And the permissions for files are set to “644”. You can do this by following the steps below:
- Access the site’s files using FTP
- Navigate to the WordPress root directory
- Right-click on the folder or file and select File Permissions
- Set the permissions to
755 for directories and 644 for files
Remove .htaccess and create a new one.
Rename wp_content/plugins, in case the problem is caused by one of the plugins.
Overwrite all WP folders and files with a fresh download.
function preserve_post_author_on_update($data, $postarr) {
if (!empty($postarr[‘ID’])) {
$original_post = get_post($postarr[‘ID’]);
$data[‘post_author’] = $original_post->post_author;
}
return $data;
}
add_filter(‘wp_insert_post_data’, ‘preserve_post_author_on_update’, 10, 2);
This code prevents WordPress from automatically changing the original author when a post is updated, especially when editing synchronized patterns or reusable blocks. It ensures the post author remains the same, even after updates.By default, WordPress changes the post author to the current user when a post is updated. So Add this code in functions.php.
@zartabwp okay, I will apply the code.
@mohamedkhafaja okay working on this.
@asifsiam97 will give feedback, thanks.