求助:编辑WordPress主题联系页面内容及移除指定代码块
Solutions for Your WordPress Contact Page Issues
Hey there, let's break down how to fix both of your WordPress problems step by step:
1. Locating the Missing Contact Page Content
It's frustrating when you can't track down where your page content lives—here are the most likely places to check:
- Database Double-Check: WordPress stores standard page content in the
wp_poststable (your table prefix might differ if you changed it). Look for rows wherepost_type = 'page',post_status = 'publish', andpost_titlematches your contact page. The content lives in thepost_contentcolumn. If you missed it before, double-check your filters or confirm if your contact page uses a custom post type. - Theme Template Files: Many themes use custom templates for contact pages. Dig into your theme folder (
wp-content/themes/your-theme-name/) for files likepage-contact.php,template-contact.php, or check atemplate-partssubfolder for contact-related components. Sometimes content is hardcoded directly into these PHP files instead of the database. - Page Builder Plugins: If your site uses a page builder (like Elementor, WPBakery, or Beaver Builder), content is often stored in
wp_postmetawith a meta key like_elementor_data(for Elementor). You can also edit the page directly in the builder's visual editor instead of hunting through code. - Shortcodes or Custom Functions: The content might be generated by a shortcode embedded in the page. Open your contact page in WordPress Admin > Pages > [Your Contact Page] and look for shortcodes that pull in contact info.
2. Removing the .sc_form_address.column-1_3 Div Block
You’ve got a few options, depending on your comfort with code:
- Quick CSS Hide: If you just need to hide the element without deleting code, add this custom CSS to your site:
Add this in WordPress Admin > Appearance > Customize > Additional CSS. This hides the element from the frontend without altering underlying code..sc_form_address.column-1_3 { display: none !important; } - Delete the Code Directly: To remove it entirely:
- If it’s in a theme template: Find the PHP file (like
page-contact.phpor a template part) that outputs the contact form/address, locate the<div class="sc_form_address column-1_3">block, and delete that section. - If it’s from a page builder: Open the contact page in your builder’s visual editor, find the address module/section linked to this div, and delete it visually.
- If it’s in a theme template: Find the PHP file (like
- PHP Hooks (Advanced): If the div is added via a theme function, check your theme’s
functions.phpfor actions that output the address. Useremove_action()to unhook that function, or modify the function itself to remove the div.
Critical Reminder
Before editing theme files or the database, always back up your site first—this lets you revert easily if something goes wrong!
内容的提问来源于stack exchange,提问作者user9158446
相关产品推荐
相关产品推荐

