wordpress 如何在 WP 中组织上传的媒体?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15703189/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:12:26  来源:igfitidea点击:

How organize uploaded media in WP?

wordpresscontent-management-systemwordpress-plugin

提问by AndreaNobili

I am new in WordPress and I came from Joomla. How can I (if I can do it...) organize the uploaded media into folder and subfolder using WordPress?

我是 WordPress 新手,来自 Joomla。我怎样才能(如果我能做到的话……)使用 WordPress 将上传的媒体组织到文件夹和子文件夹中?

If I go in my backend administration panel I have the Mediasub panel in which I can add a file (for example a jpg image). The problem is that all the files are added in the same library.

如果我进入我的后端管理面板,我有媒体子面板,我可以在其中添加文件(例如 jpg 图像)。问题是所有文件都添加到同一个库中。

I want to organize my library having subcategory\subfolder in which the uploaded file are placed.

我想组织我的库,其中包含放置上传文件的子类别\子文件夹。

For example I want have category image for: "Spring articles images" and "project management articles image", etc.

例如,我想要类别图像:“Spring 文章图像”和“项目管理文章图像”等。

How can do it?

怎么办?

采纳答案by Picturgency

Best is Enhanced Media Libraryplugin http://wordpress.org/plugins/enhanced-media-library/It's adding as many category/ taxonomies you want. Works just great. You can filter media everywhere, plus have the categories in the menu choices, can be usefull also.

最好的是增强型媒体库插件http://wordpress.org/plugins/enhanced-media-library/它添加了你想要的尽可能多的类别/分类法。效果很好。你可以在任何地方过滤媒体,加上菜单选项中的类别,也很有用。

回答by Frank Nocke

As of October 2015, WP 4.3.1I have found only two plugins actually affecting image locations as in “folders & subfolders”:

截至 2015 年 10 月,WP 4.3.1我发现只有两个插件实际上影响了“文件夹和子文件夹”中的图像位置:

  • Custom Upload Dir, but as the name says, just on upload. You can work from your %post_slug% or %categories%, upload your images in the context of these post/pages, and this tool will form subfolders from it. Which is great, SEO-wise.

    Or you just even ignore all that and mandate under “Build a path template” i.e. travels/france/paris-at-nightto upload to that subdir of your WP-Uploads folder. (Of course you'd have to keep changing for the uploads to follow. Limiting my overall faith, that this is a stable long-term tool, despite 10.000+ active installs).

  • Media File Managerallows to move already uploaded images and changes the paths in posts and pages using them accordingly. Its interface reminds of “Norton Commander 1.0” but it does the job. (Except for folder renames and deletes. So if you want to rename, better move images to a newly namend folder, then manually deleting the old.)

  • 自定义上传目录,但顾名思义,只是上传。您可以从 %post_slug% 或 %categories% 工作,在这些帖子/页面的上下文中上传您的图像,此工具将从它形成子文件夹。这是伟大的,搜索引擎优化。

    或者您甚至可以忽略所有这些并在“构建路径模板”下执行任务,即travels/france/paris-at-night上传到您的 WP-Uploads 文件夹的该子目录。(当然,您必须不断更改才能进行上传。限制了我的整体信念,即尽管有 10.000 多个活跃安装,但这是一个稳定的长期工具)。

  • 媒体文件管理器允许移动已经上传的图像并相应地使用它们更改帖子和页面中的路径。它的界面让人想起“Norton Commander 1.0”,但它确实做到了。(文件夹重命名和删除除外。所以如果要重命名,最好将图像移动到新命名的文件夹,然后手动删除旧的。)

All of the following do NOT do the job:

以下所有内容都不起作用:

  • WP Media Folderis NOT changing actual direcory location, thus not actually changing paths to your images thus also not affecting image URLs. Despite its name, Folder is just their visualisation of yet-another-taxonomy. I invested $19 to learn that.

  • Enhance Media Libraryis big, free and very popular (wordpress counts 40.000 installs) but is also not changing physical location and (thus) URLs. ? Thus the accepted answer is in my opinion wrong.

  • Media File Manager advancedappears gone and is deemed dangerous!

  • WP Media Folder不会更改实际目录位置,因此不会实际更改图像的路径,因此也不会影响图像 URL。尽管它的名字,文件夹只是他们另一个分类的可视化。我投资了 19 美元来了解这一点。

  • Enhance Media Library很大、免费且非常受欢迎(wordpress 的安装量为 40.000),但也没有改变物理位置和(因此)URL。? 因此,我认为接受的答案是错误的

  • 高级媒体文件管理器似乎不见了,被认为是危险的

回答by Sepster

I don't believe this can be done "out of the box" in wordpress; The closest thing is storing media uploads by date-based subfolders, as per the option Organize my uploads into month- and year-based folderson the media settings screen.

我不相信这可以在 wordpress 中“开箱即用”完成;最接近的是按基于日期的子文件夹存储媒体上传,根据媒体设置屏幕上的选项将我的上传组织到基于月和年的文件夹中

Next best might be to create a "dummy" page hierarchy that serves as your folder tree, and then attach your images to these. This would give you a logical grouping, which could exist in relative isolation from your actualpage or post hierarchy. But of course this won't give you the files organised like this in the file system, eg you couldn't of course FTP to this structure.

下一个最好的方法可能是创建一个“虚拟”页面层次结构作为您的文件夹树,然后将您的图像附加到这些层次结构中。这将为您提供一个逻辑分组,它可以与您的实际页面或帖子层次结构相对隔离地存在。但是当然这不会给你在文件系统中像这样组织的文件,例如你当然不能 FTP 到这种结构。

Otherwise I think you'll need to find a plugin or write something yourself to handle this.

否则我认为你需要找到一个插件或自己编写一些东西来处理这个问题。

Some plugins I found after a quick google for "wordpress plugin media folders":

我在快速谷歌搜索“wordpress插件媒体文件夹”后发现的一些插件:

While these might not be precisely what you want, they might give you clues/direction towards implementing something yourself. (Although that first one looks promising.)

虽然这些可能不是您想要的,但它们可能会为您提供自己实现某些东西的线索/方向。(虽然第一个看起来很有希望。)

Just FYI at least one similar question has been asked over on Wordpress.stackexchange:

仅供参考,在 Wordpress.stackexchange 上至少有人问过一个类似的问题:

https://wordpress.stackexchange.com/questions/13030/media-library-plugins-for-better-file-management

https://wordpress.stackexchange.com/questions/13030/media-library-plugins-for-better-file-management

It might pay to have a good hunt about over there for something more substantial . Good luck!

在那里寻找更重要的东西可能是值得的。祝你好运!

回答by Matthias Günter

Currently, media organisation is possible.

目前,媒体组织是可能的。

The "problem" with the media library in wordpress is always interesting. Check the following plugin to solve this: WordPress Real Media Library. WP RMLcreates a virtual folder structure based on an own taxonomy.

wordpress 中媒体库的“问题”总是很有趣。检查以下插件来解决这个问题:WordPress Real Media LibraryWP RML基于自己的分类法创建虚拟文件夹结构。

Drag & Drop your files

拖放您的文件

It allows you to organize your wordpress media library in a nice way with folders. It is easy to use, just drag&dropyour files and move it to a specific folder. Filter when inserting media or create a gallery from a folder.

它允许您使用文件夹以一种很好的方式组织您的 wordpress 媒体库。它易于使用,只需拖放文件并将其移动到特定文件夹即可。插入媒体或从文件夹创建画廊时进行过滤。

Turn your WordPress media library to the next level with folders / categories. Get organized with thousands of images.

RML (Real Media Library) is one of the most wanted media wordpress plugins. It is easy to use and it allows you to organize your thousands of images in folders. It is similar to wordpress categories like in the posts.

Use your mouse (or touch) to drag and drop your files. Create, rename, delete or reorder your folders If you want to select a image from the “Select a image”-dialog (e. g. featured image) you can filter when inserting media. Just install this plugin and it works fine with all your image and media files. It also supports multisite.

If you buy, you get: Forever FREE updates and high quality and fast support.

使用文件夹/类别将您的 WordPress 媒体库提升到一个新的水平。整理数以千计的图像。

RML(Real Media Library)是最受欢迎的媒体 wordpress 插件之一。它易于使用,允许您在文件夹中组织数千张图像。它类似于帖子中的 wordpress 类别。

使用鼠标(或触摸)拖放文件。创建、重命名、删除或重新排序您的文件夹 如果您想从“选择图像”对话框中选择图像(例如特色图像),您可以在插入媒体时进行过滤。只需安装这个插件,它就可以很好地处理您的所有图像和媒体文件。它还支持多站点。

如果您购买,您将获得:永远免费的更新以及高质量和快速的支持。

From the product description i can quote. If you want to try the plugin, there is also a demo on the plugin page.

从产品描述中我可以引用。如果你想尝试插件,插件页面上还有一个演示

Update #1 (2017-01-27): Manage your uploads physically

更新 #1 (2017-01-27):物理管理您的上传

A long time ago I started to open this threadand now there is a usable extension plugin for Real Media Library which allows you to physically manage your uploads folder.

很久以前我开始打开这个线程,现在有一个可用的 Real Media Library 扩展插件,它允许你物理管理你的上传文件夹。

enter image description here

在此处输入图片说明

Check out this plugin: https://wordpress.org/plugins/physical-custom-upload-folder/

看看这个插件:https: //wordpress.org/plugins/physical-custom-upload-folder/

Do you know the wp-content/uploads folder? There, the files are stored in year/month based folders. This can be a very complicated and mass process, especially when you are working with a FTP client like FileZilla.

你知道 wp-content/uploads 文件夹吗?在那里,文件存储在基于年/月的文件夹中。这可能是一个非常复杂和大量的过程,尤其是当您使用 FileZilla 等 FTP 客户端时。

Moving already uploaded files: This plugin does not allow to move the files physically when you move a file in the Real Media Library because WordPress uses the URL's in different places. It is very hard to maintain such a process. So this only works for new uploads.

移动已上传的文件:当您在 Real Media Library 中移动文件时,此插件不允许物理移动文件,因为 WordPress 在不同的地方使用 URL。维持这样的过程是非常困难的。所以这只适用于新上传。

Physical organisation on server?

服务器上的物理组织?

(Please read on if you are developer) I as developer thought about a solution about this. Does it make sense to organize the uploads on server, too? Yes, i think. Many people ask to organize it physically. I think also that the process of moving files on server and updating the image references is very hard to develop. There are many plugins out now, which are saving the URLs in their own-created database-tables.

(如果您是开发人员,请继续阅读)作为开发人员,我想到了一个解决方案。在服务器上组织上传也有意义吗?是的,我认为。许多人要求以物理方式组织它。我还认为在服务器上移动文件和更新图像引用的过程很难开发。现在有很多插件,它们将 URL 保存在自己创建的数据库表中。

Please check this thread where i explained the problem: https://wordpress.stackexchange.com/questions/226675/physical-organization-of-wordpress-media-library-real-media-library-plugin

请检查我解释问题的线程:https: //wordpress.stackexchange.com/questions/226675/physical-organization-of-wordpress-media-library-real-media-library-plugin

回答by AlanP

You can use the Media Library Folders plugin. It allows you to create folders, move or copy images to a folder and even includes a sync function to bulk add images uploaded by FTP to the server to the Wordpress media library.

您可以使用媒体库文件夹插件。它允许您创建文件夹,将图像移动或复制到文件夹,甚至包括同步功能,可将通过 FTP 上传到服务器的图像批量添加到 Wordpress 媒体库。

Media Library Folders example

媒体库文件夹示例

回答by Duy Hoang

I have gone around and found this free plugin https://wordpress.org/plugins/filebird/after very tired with a lots of files in my WordPress default media management. After I installed the plugin, I am able to organize all images and other files into folders/ categories, just drag and drop to upload/move files into folders and drag and drop to rearrange folders. enter image description hereenter image description here

在我的 WordPress 默认媒体管理中有很多文件很累之后,我已经找到了这个免费插件https://wordpress.org/plugins/filebird/。安装插件后,我可以将所有图像和其他文件组织到文件夹/类别中,只需拖放即可将文件上传/移动到文件夹中,然后拖放即可重新排列文件夹。 在此处输入图片说明在此处输入图片说明

回答by x4wp

All the plugins listed above have a serious problem - they are using the virtual folders implemented via WordPress Taxonomy API, while X4 Media Libraryis using the real physical folders located in your wp-content/uploadsdirectory on the server.

上面列出的所有插件都有一个严重的问题——它们使用的是通过 WordPress Taxonomy API 实现的虚拟文件夹,而X4 Media Library使用的是位于wp-content/uploads服务器目录中的真实物理文件夹。

What happens when you put some images to the folder using any plugin listed above? Because of they are using the virtual folders, the destinition folder is represented as a taxonomy tag in the database, so they just assign the folder's tag to moved files.

当您使用上面列出的任何插件将一些图像放入文件夹时会发生什么?因为他们使用的是虚拟文件夹,所以目标文件夹在数据库中被表示为一个分类标签,所以他们只是将文件夹的标签分配给移动的文件。

There are no real modifications happened on your physical disk, in the wp-content/uploadsdirectory. You can see that images URL didn't change when you move them to another folder.

wp-content/uploads目录中的物理磁盘上没有发生真正的修改。您可以看到当您将图像移动到另一个文件夹时,图像 URL 没有改变。

Alternatively, with X4 Media Library if you put some files to the folder they will really be moved to that physical folder on your disk, in the wp-content/uploadsdirectory, and the images URL will be changed automatically.

或者,使用 X4 媒体库,如果您将一些文件放入文件夹,它们将真正移动到磁盘上的物理文件夹,在wp-content/uploads目录中,并且图像 URL 将自动更改。

Moreover, this plugin will make sure that all the links associated with these images in all your Posts, Pages and other custom types will be updated automatically.

此外,此插件将确保所有帖子、页面和其他自定义类型中与这些图像关联的所有链接都将自动更新。

回答by user3475649

The plugin Media File Manager advanced is amazing and allow you to create folders and subfolders very easily and move files with a simple drag & drop.

插件 Media File Manager advanced 非常棒,允许您非常轻松地创建文件夹和子文件夹,并通过简单的拖放移动文件。

Check it at: http://wordpress.org/plugins/media-file-manager-advanced/

检查它:http: //wordpress.org/plugins/media-file-manager-advanced/

回答by Jiwoks

Check this plugin WP Media Folderat Joomunited, you can:

在 Joomunited检查这个插件WP Media Folder,你可以:

  • Create visual folders and move file inside
  • Restrict file visualisation
  • Create galleries from folders
  • ...
  • 创建可视文件夹并在其中移动文件
  • 限制文件可视化
  • 从文件夹创建画廊
  • ...

Since the last months they add a lot of must use features.

自上个月以来,他们添加了许多必须使用的功能。

This is a paid plugin but it worth the money, I install it now by default on all my customers websites.

这是一个付费插件,但物有所值,我现在默认安装在我所有客户的网站上。