Comment vérifier si j'ai lié à un message avant de le supprimer?
-
-
Jene saispas commentfaire cela,maispeut-être que vousne pouvezpasessayer ceci: Déplacez lemessage dans la corbeilleet utilisez unplugin de vérification de lien.Si leplugin du vérificateur de lienest suffisammentintelligent,il devrait vousindiquertous les liens renvoyant à lapublication que vousn'avezplus visible sur le site.Not sure how to do this but maybe you cant try this: Move the post to trash and use a link checker plugin. If the link checker plugin is clever enough it should tell you any links linking to the post you have no longer visible on the site.
- 0
- 2011-05-10
- Scott
-
+1pour uneexcellente question.L'idée serait de scanner le contenu detous lesmessages,mais celapeut êtrepéniblepour ungros site ayant ungrandnombre demessages.Je leferaisen sauvegardant untableau sérialisé de liens d'un article dans sonpostmeta (pournouveauet pourexistant),puisinterroger cetteméta-info àpartir de latablepostmetaet parcouriret renvoyer une série d'identifiants depublication qui renvoient à l'articleen cours de suppression.Vouspouvez soit l'arrêter,soit luifaireprendre lesmesures que vous souhaitez.+1 for a great question. Idea would be to scan post content of all the posts but it can be a pain for a big site having a large no of posts. I would do it by saving a serialized array of links of a post in its postmeta (for new & for existing) and then query this meta info from postmeta table and scan through and return a arry of post IDs which link to the post being deleted. You can either halt it or make it to take whatever action you want.
- 1
- 2011-05-10
- Ashfame
-
@Ashfame: Suggestionintéressante.Maintenant,si vous voulez créer unpluginpour cela ...@Ashfame: Interesting suggestion. Now if you would create a plugin for it...
- 0
- 2011-05-10
- Jan Fabry
-
Un autre +1plus unfav.@Jan Fabry & @Ashfame - Je suis sûr que vous vouleztravaillerensemble sur celui-ci!:)Another +1 plus a fav. @Jan Fabry & @Ashfame - I'm sure you want to work together on this one! :)
- 0
- 2011-05-10
- kaiser
-
@ user3047 Vousne voulezpasmarquer celui-ci comme résolu?@user3047 Don't you want to mark this one as solved?
- 0
- 2011-09-05
- kaiser
-
4 réponses
- votes
-
- 2011-05-10
Après avoir lu cefil,j'ai vu quej'en avaisparfoisbesoin. Voici donc le résultat:
Leplugininterne du vérificateur de liens
Il ajoute uneméta-boîte à vos écrans demodification depublication qui affiche des liens verstous lesmessages qui sont liésen interne aumessage actuellement affiché. Si vous souhaitezmodifier la sortie (ajouter quelque choseparexemple),veuillez utiliser lefiltrefourni. Unexemple d'utilisation dufiltrepeut êtretrouvé dans lefichier readme.
Lepluginest sous licence GPL2. Peut-être queje vais également lemettre dans le référentiel officielpourpermettre l'installation depuis votreblog auto-hébergé. Modifier: Terminé.
... ou à ...
... ou dans lenôtre
After reading this thread I saw that I might need this also sometimes. So here is the result:
The internal link checker plugin
It adds a meta box at your post edit screens that shows links to all posts who link internally to the currently displayed post. If you want to alter the output (add something for eg.), please use the provided filter. An example of how to use the filter can be found at the readme file.
The Plugin is GPL2 licensed. Maybe I'll also put it in the official repo to allow installation from inside your self hosted blog. Edit: Done.
...or at...
...or in our own
-
Etmerci à @Drakepour avoirfourni la requête sql (s'il vousplaît alleret voter sa réponse).And thanks to @Drake for providing the sql query (please go & upvote his answer).
- 0
- 2011-05-10
- kaiser
-
Unpeu rugueuxmaisfonctionne unpeu.Si vous avezplusieurs liens dans lemêmemessage,des doublons seront affichés.Solution acceptée.A bit rough but kinda works. If you have multiple links in the same post it will show duplicates. Accepted solution.
- 0
- 2011-09-06
- user3047
-
Mercipour l'information.Jen'en étaispas conscient.Va changer dans unefuture version.Thanks for the heads up. Wasn't aware of that. Will change in a future version.
- 0
- 2011-09-06
- kaiser
-
- 2011-05-10
Vouspouvezfaire une requête comme:
SELECT ID, post_title, post_date, post_content FROM wp_posts WHERE post_content LIKE '%your-post-title%' ORDER BY post_date
pour obtenirtous lesmessages liés à cet ancien article,classéspar date.
You can do a query like:
SELECT ID, post_title, post_date, post_content FROM wp_posts WHERE post_content LIKE '%your-post-title%' ORDER BY post_date
to get all posts that linked that old post order by date.
-
- 2011-05-10
Iln'y apas detable ou de structure de données distincte qui conserve les liens depublication àpublication. Lameilleurefaçon de lefaireest donc de rechercher dans vospublications l'URL de lapublication que vous souhaitez supprimer.La recherchefonctionne sur le code HTML de l'article,il contiendra donc le lien complet,même si vousne le voyezpas dans l'éditeur visuel.
Bien sûr,vous devriez également rechercher dans lespages,carellespeuvent également contenir des liens vers des articles.
Une autre approche consisterait à utiliser Google.Si vous recherchez le
link:http://example.com/2011/05/post-to-delete/
,il renverratoutes lespages qui y renvoient.Vouspouvez également ajoutersite:example.com
pour limiter les résultats aux seulespages de votre site.Bien sûr,cene serapas aussi àjour qu'une recherche dans votreproprebase de données actuelle.There is no separate table or data structure that keeps post-to-post links, so the best way to do this is to search your posts for the URL of the post you want to delete. The search works on the HTML code of the post, so it will contain the full link, even if you don't see it in the visual editor.
Of course, you should also search through the pages, since they can also contain links to posts.
Another approach would be to use Google. If you search for
link:http://example.com/2011/05/post-to-delete/
it will return all pages that link there. You can then also addsite:example.com
to limit the results to only pages on your site. Of course, this will not be as up-to-date as a search in your own current database.-
Bonneidée.Mais leblog dontje parleestprivé ...Great idea. But the particular blog I'm dealing with is private...
- 0
- 2011-05-10
- user3047
-
Sije veux supprimer "entoute sécurité" unmessage.Je veuxm'assurer qu'aucun lienn'existe (dansmonblog) vers lemessage "à supprimer".Commentfaire ça?