WordPress 7.1 Beta 1 adds smarter gallery behavior that can pull in and sort media attached to the current post, while the inserter surfaces attached images. Sites with reused media, custom attachment order, gallery plugins, imports, and revisions should confirm which images appear and why.
Use this for portfolios, real estate, products, events, newsrooms, recipes, or migrated sites where gallery order, captions, alt text, featured images, and reused media are part of the published page.
Quick answer
WordPress 7.1 Attached Images Gallery Sort Regression Test should be handled with a narrow evidence-first workflow: build attachment fixture, record order fields, test editor sorting, then verify the result before making broader changes.
What to check first
- Create a post with newly uploaded images, reused library images, a featured image, an unattached image, and one image attached to another post.
- Record attachment parent, upload time, menu order, filename, caption, alt text, orientation, and intended gallery position.
- Insert an automatic attached-images gallery, change sort controls, reorder manually, save revisions, and restore an older revision.
- Compare editor, preview, public HTML, REST response, feed, mobile layout, lazy loading, and CDN image URLs.
- Retest media replacement, gallery lightbox, optimization, offload, import, translation, and custom attachment-query plugins.
Diagnostic table
Use this table to keep the work practical. It connects the symptom to evidence and a verification step.
| Action | Evidence to collect | How to verify |
| Build attachment fixture | Create a post with newly uploaded images, reused library images, a featured image, an unattached image, and one image attached to another post. | Only intended attached images appear and their order matches the selected rule. |
| Record order fields | Record attachment parent, upload time, menu order, filename, caption, alt text, orientation, and intended gallery position. | Captions, alt text, links, sizes, and responsive attributes remain attached to the correct image. |
| Test editor sorting | Insert an automatic attached-images gallery, change sort controls, reorder manually, save revisions, and restore an older revision. | Revision restore and manual reorder produce a predictable public result. |
| Compare all outputs | Compare editor, preview, public HTML, REST response, feed, mobile layout, lazy loading, and CDN image URLs. | REST, feed, mobile, cache, and gallery plugins show the same approved sequence. |
Why this usually happens
- Attachment parent reflects how a file entered WordPress, not necessarily every post where the image is reused.
- Upload date, menu order, filename, and manual block order can produce different sequences.
- Restoring a revision may restore block markup without reverting attachment parent or metadata.
- Gallery and media plugins can replace the core query, image attributes, or front-end order.
Useful command or data shape
Adapt paths, IDs, and privacy handling to the site before running commands or storing data on production.
wp post list --post_type=attachment --post_parent=456 \
--fields=ID,post_title,post_parent,menu_order,post_date --order=ASC
wp post meta get 456 _wp_attachment_metadata --format=json
curl -sS --max-time 15 'https://example.com/wp-json/wp/v2/media?parent=456&per_page=100' | jq 'map({id,slug,caption:.caption.rendered})'
Safe fix order
Do the work in a sequence that makes each result easy to prove. Stop if a step produces new evidence that changes the incident scope.
- Build attachment fixture
- Record order fields
- Test editor sorting
- Compare all outputs
- Test media plugins
What to tell the client or owner
Share post and attachment IDs, parent and menu order values, selected sort rule, editor and public order, restored revision, plugin state, and cache headers.
Production verification checklist
- Only intended attached images appear and their order matches the selected rule.
- Captions, alt text, links, sizes, and responsive attributes remain attached to the correct image.
- Revision restore and manual reorder produce a predictable public result.
- REST, feed, mobile, cache, and gallery plugins show the same approved sequence.
Mistakes to avoid
- Do not judge the fix by one browser or the homepage only.
- Do not delete evidence before recording usernames, file paths, timestamps, and response headers.
- Do not add a cache, security, or tracking plugin while the original problem is still unclear.
- Do not leave test users, temporary debug logs, or broad API keys active after verification.
When HandL WP should help
Bring in help when this affects leads, checkout, search visibility, malware risk, paid media reporting, or a client production site. HandL WP can trace the issue through WordPress, hosting, cache, tracking, and Search Console, then verify the workflow after the technical fix.
If this is active on a production site, test a WordPress 7.1 gallery change.
Related HandL WP guides
Use these related guides when the same issue touches tracking, security, checkout, or crawler visibility.
Test the Gutenberg 23.7 Dynamic Gallery Detach path
When a gallery is converted to static Image blocks, run the Gutenberg 23.7 Dynamic Gallery Detach and one-step undo regression test before editors change production content.
Helpful references