Honestly, it’s source code. The only people who see it are you and other developers. Anybody casually visiting your website will never know or understand this stuff so really there’s no harm keeping it there. Buttttt… if you want to get rid of it you could filter body_class:
function custom_body_class( $classes ) {
global $post;
if( isset( $post ) && is_object( $post ) ) {
$classes = array( "page-{$post->ID}" );
}
return $classes;
}
add_filter( 'body_class', 'custom_body_class' );
Related Posts:
- add_filter the_content str_replace after shortcode
- Correct regex for wp_embed_register_handler
- WordPress Ajax always returns a 404 error
- WordPress custom taxonomy description for each post?
- Conditional statement for parent, child and grandchild pages
- How to use SRCSET with get_the_post_thumbnail()?
- How do I make wordpress comment fields required?
- How to add a post or page tag to the list of classes appearing in the body tag’s class attribute?
- WordPress Wysiwyg Content not being displayed
- Javascript code inside “” in core WordPress files .php
- HTML table from shortcode with multiple parameters
- How do I add HTML to a PHP function [closed]
- Slide in Panel WordPress Post
- Upload Image in a WordPress page using PHP
- Removing unneccessary p-tags (Not every p)
- WordPress automatically adding html tag around PHP code
- Missing sidebar parameter “fix” – before_content
- How to get the POST TITLE using the POST ID?
- Load a page into a div with Ajax
- My form action url is being prepended with a directory that does not exists
- Converting HTML Template to WordPress Theme
- Multiple options not staying selected after saving
- custom fields wordpress
- Why the JavaScript code is ignored from wp editor?
- Populate dropdown with Child Pages based on Parent Page chosen
- How to change redirection route to a php page for making it only accessible by logged-in members?
- How to remove ?wp-mce-4103-20162941
- Why Won’t My Inputs in a form with a Get method work together?
- parts of url disappear when using # inside href=”” [closed]
- How to get the value of input hidden html from text editor to custom page template?
- Dot is not added at the end of href
- Add .htm extention to a custom taxonomy
- Show latest posts in a plain HTML website custom widget [closed]
- Hide HTML element (by class or ID) with PHP
- Path for php file for inserting data through html form
- Widget back end radio button issue
- How to remove coupon dropdown feature
- Add shortcode in my div
- Add html link in functions.php files of the theme
- PHP contact form not redirecting [closed]
- How to Schedule Cronjobs for start of every month and year
- Handling PHP/HTML inside the output of a shortcode function
- Illegal string offset error in wordpress theme options textarea
- Need help removing […] after excerpt
- Initial offset of number of posts in home page on the posts page
- WordPressUser Submission Form
- Shortcode displaying at the top of the page [duplicate]
- Is it possible to isolate and use WordPress functions outside of wordpress
- Time Delay a URL Redirect for Specific Page
- Cascading dropdown select search based on Parent Page & Child Page
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Display WordPress search results based on the selected Sub-Category
- Background image no longer fits to screen now that project is in php files
- How do I call a value from the datase using ajax
- Search bar for wp menu
- Adding HTML Code to Replace Text in PHP
- Executing php on button press
- Shortcode in Shortcode/HTML Graphics and Pictures
- I can’t go to the page archive-{post_type}.php
- WP Website is shown in HTML
- Use Search Term in html link and redirect
- Mysterious letters appearing at the top of a few pages
- Current WordPress Page Title as Search Parameter into A Tag
- If user has clicked link add class and store using PHP/WordPress
- HTML Formatting “single_term_title()”?
- How to Protect a private folder inside uploads folder, if User is not Logged In?
- How to center all text body in single.php at once?
- sessionStorage saves input value in browser but it is not loaded in the form field
- Collapsible menu on post sidebar only expands and does not collapse
- Changable favicon
- How can I get my pagination loop to display the correct number of total pages?
- AMP version of e-commerce without plugin
- Use PHP to inject HTML into before page renders?
- How to make a parent page for author.php?
- Creating Log-In Page for backend server
- user update profile for custom code
- Vertical Menu for one page only
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Multisite – Display different header content based on which site is accessed
- Splitting table data to pages with numbers
- Show post/page into div using function
- wordpress, Category ID
- html to posts, jpg to featured image, zip file contains jpg and html
- How do you change the tag font size in the repeater-template.php [closed]
- PHP tag in post content makes wordpress go crazy
- How to only fetch certain Tag ID’s
- Where to find the html for WordPress site? [closed]
- RegExp to EXCLUDE strip HTML (FOR SOMME) comments
- Pagination for div’s
- wp nav menu without label
- Pass the updated value of aid from form using ajax
- Show contact 7 form in popup
- How Can I Center the Logo in the Navigation Menu? [closed]
- Arrange Category post manually when displayed
- HTML in PHP problem [closed]
- How to customize posts in WordPress by using HTML and CSS?
- Header location [closed]
- Remove post image caption from post_excerpt();
- How to enqueue structured data as file – jsonld file seems not to work
- How can I change text on my SearchWP search results page, as this is not an editable page in WordPress?