
- #OMEGA THEME WORDPRESS MEDIA META DATA HOW TO#
- #OMEGA THEME WORDPRESS MEDIA META DATA UPDATE#
- #OMEGA THEME WORDPRESS MEDIA META DATA CODE#
Tips: Instead of uploading media directly to your website, you should upload them on another storage platform like Youtube, Imgur, … and embed their links in the article. You can refer to some plugins for removing media faster such as WP-Optimize or Media Cleaner. However, this way will take a lot of time when the number of photos and videos is too much. Generally, to delete these media, we go to Media > Library, select images / videos and hit Delete. These data will slow down your website, so you should delete them. When you upload photos and videos to the Media Library, WordPress may create several copies of multiple sizes for display in different places. You can delete tags and categories directly from the Admin Dashboard by going to Post > Tags / Categories, then select the tags or categories that you want to delete and press Delete. If you are still confused between Post and Page, please refer to this article! Categories and Tags Go to Pages in Admin Dashboard, choose All Pages, select the page that you want to delete then press Trash. You should remove unnecessary or unsuitable pages to unload your website.

#OMEGA THEME WORDPRESS MEDIA META DATA CODE#
Code to limit the time for auto-saving drafts:.Code to limit the maximum number of drafts:.To do that, add the following code to the wp-config.php file: The easiest way to do that is using a plugin as in part 2 of this article.Īnyway, you should reduce the amount of auto-generated drafts by limiting the number of them for a post and the time to auto-save one. Therefore, if you don’t need these drafts anymore, let’s delete them. These drafts take up space on the website. The Revision feature of WordPress helps to generate drafts to save changes in posts and restore them in case there are any problems (power failure, Internet disconnection, etc.). You should periodically review the contents on your website and delete the duplicated, outdated ones, and the articles that have incorrect information as well.įor example, if your website has the article “Top 10 best food stores in Hanoi” but after a while they closed or relocated, you should edit or delete this article.
#OMEGA THEME WORDPRESS MEDIA META DATA HOW TO#
So, you can refer to this article to learn about how to completely remove a plugin’s data on the WordPress website. You can delete a plugin directly from the Admin Dashboard, but this doesn’t completely remove all the plugin’s related data. So if you don’t need to use a plugin anymore, let’s delete it. Some plugins can auto-generate data, thereby slowing down the website loading speed.

#OMEGA THEME WORDPRESS MEDIA META DATA UPDATE#
When you click on Publish or Update, your input will be passed to this function, so you need to save your input to the WordPress database and update your post meta key value pair.In addition, if you want to improve the performance of your WordPress theme, refer to this article. This is where you actually save the inputs in your meta box. add_action( 'edit_attachment', array( $this, 'save_attachment_meta_box_data') ) Step 5: Add save_attachment_metabox_data function In this case, you use the edit_attachment action in order to save any inputs in your meta box. However, with media items, or what WordPress refers to as attachments, you need to use a different process. Typically when you save a post type, you hook into that saving process with save_post_custom_post_type. public function setup_attachment_metaboxes() Step 4: Add edit_attachment action to _construct method

The add_meta_box WordPress function below is where you actually add the meta box to the media library. Step 2: Add setup_attachment_metaboxes function add_action('add_meta_boxes_attachment', array( $this, 'setup_attachment_metaboxes' ))

The code below allows you to hook into the add_meta_boxes_attachment action so that you can add meta box to all media items in the media library. Step 1: Add add_meta_boxes_attachment function to _construct method Again, we’re using the WordPress plugin boilerplate as the framework for our plugin as it’s super solid, really well organized, and makes creating WordPress plugins a breeze.Ĭheck out our post introducing working with the WordPress Plugin Boilerplate if you would like to learn more. All of the code snippets shown below need to be added to your class-plugin-name-admin.php file. There are 5 steps involved in adding a meta box in WordPress’ Media library with a plugin.
