How to Fix Alignment in WordPress: Step-by-Step
In this article
To fix alignment in WordPress, first identify whether the problem comes from the block editor, the theme, or custom CSS. Then correct the block settings, clear any conflicting styles, and test on both desktop and mobile. Most alignment issues are caused by missing alignment options in the block toolbar, theme CSS overriding your settings, or content pasted from another editor carrying inline styles. This guide walks through each cause and the exact steps to resolve it.
What You'll Need
- Administrator access to your WordPress dashboard
- A page or post where the alignment issue appears
- Access to Appearance > Customize or your theme's stylesheet (for CSS fixes)
- Optional: a staging site or backup before editing theme files
Step-by-Step
- Check the block toolbar. Click the block that is misaligned. In the toolbar that appears above or beside it, look for the alignment icons (left, center, right, justify). If the icons are missing, the block type may not support alignment, or your theme has disabled them. Try converting the block to a Paragraph or Heading block, which usually support alignment.
- Use the block settings sidebar. With the block selected, open the settings sidebar (gear icon). Under the Block tab, check for alignment options. Some blocks, like Image, offer both image alignment and caption alignment. Set the correct one.
- Clear inline styles from pasted content. If you pasted text from Word or Google Docs, it may carry inline styles that override WordPress alignment. Select the block, open the toolbar's More options (three dots), and choose Edit as HTML. Remove any
style="text-align:..."attributes, then update. Alternatively, paste as plain text and reapply formatting. - Check for theme CSS conflicts. Some themes force alignment on certain elements. Open your browser's developer tools (right-click the misaligned element and choose Inspect). Look at the Styles panel to see which CSS rule is applying the alignment. If it comes from your theme, you can override it with custom CSS in Appearance > Customize > Additional CSS. For example, to force left alignment on paragraphs:
p { text-align: left !important; }. Use!importantsparingly. - Verify the theme supports alignment for that block. Some themes disable wide and full-width alignment. If you are trying to use those, check Appearance > Customize > Layout or the theme documentation. If the theme does not support it, you may need to add a CSS class or switch themes.
- Test with a default theme. Temporarily switch to a default WordPress theme (like Twenty Twenty-Four) and check if the alignment issue persists. If it disappears, the problem is in your theme. If it remains, the issue is in the block or content.
- Clear caches. After making changes, clear any caching plugin, CDN, and browser cache. Alignment fixes often do not appear until caches are cleared.
- Check mobile responsiveness. Alignment that looks fine on desktop may break on mobile. Use the responsive preview in the editor or your browser's device toolbar. Adjust CSS media queries if needed, or use blocks that are responsive by default.
- Use a page builder's alignment settings if applicable. If you use Elementor, Beaver Builder, or similar, alignment is controlled within the builder's interface, not the WordPress block editor. Look for alignment options in the module settings, and check for conflicting global settings.
- Validate HTML. Broken HTML tags (like an unclosed
<div>) can cause alignment to break. Use the Edit as HTML view to check for unclosed tags, or run the page through an HTML validator.
Common Mistakes
- Using
!importantin CSS without understanding specificity, which can break other styles. - Forgetting to clear caches after making changes, leading to the belief that the fix did not work.
- Pasting content from Word without cleaning inline styles, which override block alignment.
- Assuming all blocks support alignment; some do not, and you may need to use a different block or a group block.
- Editing theme files directly instead of using a child theme or Additional CSS, which loses changes on theme update.
Tips
- Use the List View in the editor to see the block structure and identify nested blocks that may have their own alignment settings.
- When using custom CSS, target specific blocks with classes like
.wp-block-paragraphto avoid affecting other elements. - Keep a backup before making CSS changes, especially if you are not using a child theme.
- Use the Preview button to check alignment on different screen sizes before publishing.
- If alignment issues are widespread, consider using a theme that explicitly supports full-width and wide alignment for blocks.
Troubleshooting
If alignment still does not work after following the steps, try these checks:
- Disable plugins one by one. A plugin that adds custom CSS or modifies the editor could be interfering. Deactivate all plugins and reactivate them one at a time to find the culprit.
- Check for JavaScript errors. Open the browser console (F12) and look for errors. A JavaScript error in the editor can prevent alignment controls from working.
- Reset the block. Select the block and choose Reset from the toolbar's more options menu. This removes custom styles and returns the block to default settings.
- Inspect the front end vs. editor. Sometimes the editor shows correct alignment but the front end does not, or vice versa. This indicates a theme or caching issue. Compare the two and check for CSS that only applies to one context.
- Review theme documentation. Some themes require specific settings for alignment, such as enabling wide alignment in the theme options.
- Ask your host or developer. If you are not comfortable editing CSS or theme files, seek help from a qualified developer. Incorrect CSS can break your site's layout.
Frequently Asked Questions
Why are alignment options missing from my block toolbar?
The block type may not support alignment, or your theme may have disabled it. Try a different block (like Paragraph) or check theme settings.
How do I center an image in WordPress?
Select the Image block, then click the center alignment icon in the block toolbar. If it does not work, check for theme CSS overriding it.
Can I align text differently on mobile?
Yes, but it requires custom CSS with media queries. The block editor does not provide responsive alignment controls by default.
Why does my alignment change after I update the page?
This often happens when inline styles from pasted content conflict with block settings. Clean the HTML or paste as plain text.
Does switching themes fix alignment issues?
It can, if the issue is caused by theme CSS. Test with a default theme to confirm.
Is it safe to edit theme files directly?
No, use a child theme or the Additional CSS option in the Customizer to avoid losing changes on theme updates.