Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

What is: Attachment

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

The term attachment is used for files uploaded to WordPress from post edit screen. When a file is uploaded using the Add Media button from post edit screen, that file automatically becomes an attachment of that particular post. Files uploaded directly to the Media Library are not particularly attached to a post or page. An attachment can be any file that can be uploaded using the media upload.

Theme developers can use attachment feature using template tags and conditional template tags to manipulate the appearance of the posts with the attachments. One common example of developers using attachments in conjunction with posts is the use of Post Image; these images can be set to a default, a category image, or a new image for each post (which could be a attachment of that post displayed in the particular way that the theme is setup to display it).

Media Library sub panel can also be used to attach media to specific posts after having been uploaded into the media library. Media that is uploaded into a specific post, or referenced into a specific post automatically becomes attached to that post. Media that is attached to posts can also become unattached when the posts are deleted from WordPress. These media can become re-attached to a new post in the same way that they were attached to the original post. Media can also be attached to multiple posts at the same time and become unattached to any one of the posts if needed.

Additional Reading

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!