MySQL WordPress oprhan postmeta CleanUp

[vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ width=”1/1″ tablet_text_alignment=”default” phone_text_alignment=”default”][vc_column_text]If your blog get agged probably it get slow . To clean up old SQL entrys there are several plugins but some time like in my case you need to delete millions of outdated Orphaned Post Meta  , than plugins will timeout your SQL Database.

Especially if you experiment with  post  plugins loops can cause very fast tausend of duplicated post and metas.[/vc_column_text][divider line_type=”Small Line” line_thickness=”1″ divider_color=”default”][/vc_column][/vc_row][vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ width=”1/1″ tablet_text_alignment=”default” phone_text_alignment=”default”][vc_column_text]This is the first try to explore and dig a bit deeper into the Developer World , not only from the code and benefit side but also to learn more about the style and thinking that build the red line thru all his work . Many times phantastic people nearly disappear online and there Blogs get abandoned . Most likely one of the Big 5 IT cooperation already hired him and no time for free plugins or Blogging .[/vc_column_text][vc_row_inner text_align=”left”][vc_column_inner column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ width=”1/1″][/vc_column_inner][/vc_row_inner][vc_column_text]

  • Revisiones
  • Auto drafts
  • Deleted comments
  • Unapproved comments
  • Spammed comments
  • Deleted comments
  • Orphaned post meta
  • Orphaned comment meta
  • Orphaned user meta
  • Orphaned term meta
  • Orphan term relationships
  • Unused terms
  • Duplicated post meta
  • Duplicated comment meta
  • Duplicated user meta
  • Duplicated term meta
  • Transient options
  • Optimizes database tables
  • oEmbed caches in post meta

[/vc_column_text][nectar_gradient_text heading_tag=”h1″ color=”extra-color-gradient-1″ gradient_direction=”horizontal” text=”WP Sweep”][vc_column_text]Wp- Sweep is from the Developer Lester Chan a well known high profile WordPress Developer . The Plugin works smooth and clean following WordPress Tables and Terms as long they stay below 100.000 entry then it still works but can take extremely long and outtime your SQL Database on a shared host[/vc_column_text][vc_row_inner text_align=”left”][vc_column_inner column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ width=”1/1″][vc_column_text]The image below show the wp sweep admin screen after cleanup .[/vc_column_text][nectar_image_with_hotspots image=”5933″ preview=”https://metaprime.at/blogapp/wp-content/uploads/2016/09/Screen-Shot-2016-09-29-at-12.53.49.jpg” color_1=”Accent-Color” hotspot_icon=”plus_sign” tooltip=”hover” tooltip_shadow=”none”][nectar_hotspot left=”96.31236442516268%” top=”37.2093023255814%” position=”top”][/nectar_hotspot][nectar_hotspot left=”11.496746203904555%” top=”41.08527131782946%” position=”top”][/nectar_hotspot][nectar_hotspot left=”13.882863340563992%” top=”13.178294573643413%” position=”top”][/nectar_hotspot][/nectar_image_with_hotspots][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row][vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ width=”1/1″ tablet_text_alignment=”default” phone_text_alignment=”default”][vc_text_separator title=”MYSQL query to delete orphaned postmeta “][vc_column_text]Of course before you make any change or clean up in your database dont forget the full backup . For a faster access i use a client like Sequel Pro to manage all the Databases[/vc_column_text][vc_column_text]<code>

DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL

</code>[/vc_column_text][/vc_column][/vc_row][vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ width=”1/1″ tablet_text_alignment=”default” phone_text_alignment=”default”][image_with_animation image_url=”5938″ alignment=”center” animation=”Fade In” box_shadow=”small_depth” max_width=”100%”][/vc_column][/vc_row]

0 0 votes
Article Rating
Subscribe
Notify of
guest
1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
RATRI GALUH PRATIWI
December 11, 2019 4:27 am

but also to learn more about the style and thinking that build the red line thru all his work