[wp-trac] [WordPress Trac] #64732: Images Inserted into a Post Using Links with Center Alignment, Edited and Saved as HTML, Display Left Aligned

WordPress Trac noreply at wordpress.org
Thu Feb 26 02:50:23 UTC 2026


#64732: Images Inserted into a Post Using Links with Center Alignment, Edited and
Saved as HTML, Display Left Aligned
----------------------------------+-----------------------------
 Reporter:  ann47he1rpjggx6f3yso  |      Owner:  (none)
     Type:  defect (bug)          |     Status:  new
 Priority:  normal                |  Milestone:  Awaiting Review
Component:  Posts, Post Types     |    Version:  6.9
 Severity:  normal                |   Keywords:  has-screenshots
  Focuses:                        |
----------------------------------+-----------------------------
 I believe a bug was introduced in WordPress v6.9 and the v6.9.1 upgrade
 did not resolve it.

 The bug involves images inserted into a post using links with center
 alignment, edited and saved as HTML.

 I have verified that the issue presents when using other themes to rule
 out the possibility of my theme being the issue. I have also verified that
 the issue presents after disabling most of my plugins (one by one), with
 the exception of Force Login, UpdraftPlus - Backup/Restore, and Wordfence
 Security. I did not disable those plugins because I don't think they would
 impact how WordPress generates pages.

 Following is the process, in detail, that I have used for a number of
 years without issue until the WordPress 6.9 upgrade.

 First I upload the image(s) I plan to use in a post to my server using
 SFTP.

 Then I commence to insert the image(s) into a post using the / Image
 option. I select the ''Align Center'' option, click the ''Insert from
 URL'' option, and then I enter the URL to the image location on my server.

 Link:[https://imgbox.com/75oGasc5]

 After the image appears, I then click the far right option (three dots
 stacked vertically) and select ''Edit as HTML''.

 Link:[https://imgbox.com/HZFITFSM]

 I then enter a custom CSS class to make higher spacing above and/or below
 the image.

 Link:[https://imgbox.com/VCncuYnh]

 When I click out of the code area, I get the following error:

 Link:[https://imgbox.com/eyxk0Gpj]

 At that point, I click the far right option (three dots stacked
 vertically) and select the ''Convert to HTML'' option and then I save the
 post.

 Link:[https://imgbox.com/4oBGjEmr]

 However, after upgrading to WordPress 6.9, as well as WordPress 6.9.1, the
 ''aligncenter'' part of the code is basically ignored.

 Link:[https://imgbox.com/HgbUdJV5]

 Following is one of the custom CSS classes that I created and use for more
 white space above and/or below images:

 {{{
 .image-margin-default {
   margin-bottom: 30px;
   margin-top: 30px;}
 }}}

 A workaround would be just to not edit the inserted images as HTML and use
 the code editor to insert my CSS custom class. However, that leaves the
 ugly error referenced above in my posts and I would have to use the code
 editor to view the image code or to make any necessary future changes. I
 think things should work as they did prior to the WordPress v6.9 upgrade.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64732>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list